mirror of
https://github.com/e107inc/e107.git
synced 2025-08-27 16:20:13 +02:00
Core modifications to support Hybridauth 3
- MOD: Replaced e107::getPref('social_login') with SocialLoginConfigManager::getValidConfiguredProviderConfigs() - FIX: signup_shortcodes updated with new social login providers - MOD: e107::filter_request() code de-duplication: HTTP 400 exits - MOD: Deprecated e107::getHybridAuth() to discourage direct access to third-party dependency Hybridauth - FIX: Updated e_user_provider for Hybridauth 3 - FIX: e_user::tryProviderSession() and Hybridauth 3 - NEW: Dynamic auth provider support in social_adminarea - NEW: Database migration for social plugin's social_login pref
This commit is contained in:
127
e107_tests/tests/unit/plugins/social/social_setupTest.php
Normal file
127
e107_tests/tests/unit/plugins/social/social_setupTest.php
Normal file
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
/**
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2020 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
class social_setupTest extends \Codeception\Test\Unit
|
||||
{
|
||||
public function testUpgrade()
|
||||
{
|
||||
include_once(e_PLUGIN . "social/SocialLoginConfigManager.php");
|
||||
include_once(e_PLUGIN . "social/social_setup.php");
|
||||
|
||||
e107::getConfig()->set(SocialLoginConfigManager::SOCIAL_LOGIN_PREF, SOCIAL_LOGIN_LEGACY_DATA);
|
||||
$social_setup = new social_setup();
|
||||
$this->assertTrue($social_setup->upgrade_required());
|
||||
$this->assertIsArray(e107::getConfig()->getPref(SocialLoginConfigManager::SOCIAL_LOGIN_PREF . "/AOL"));
|
||||
$this->assertIsNotArray(e107::getConfig()->getPref(SocialLoginConfigManager::SOCIAL_LOGIN_PREF . "/AOL-OpenID"));
|
||||
|
||||
$social_setup->upgrade_pre();
|
||||
$this->assertFalse($social_setup->upgrade_required());
|
||||
$this->assertIsNotArray(e107::getConfig()->getPref(SocialLoginConfigManager::SOCIAL_LOGIN_PREF . "/AOL"));
|
||||
$this->assertIsArray(e107::getConfig()->getPref(SocialLoginConfigManager::SOCIAL_LOGIN_PREF . "/AOL-OpenID"));
|
||||
}
|
||||
}
|
||||
const SOCIAL_LOGIN_LEGACY_DATA =
|
||||
array(
|
||||
'FakeProviderNeverExisted' =>
|
||||
array(
|
||||
'enabled' => '1',
|
||||
),
|
||||
'AOL' =>
|
||||
array(
|
||||
'enabled' => '1',
|
||||
),
|
||||
'Facebook' =>
|
||||
array(
|
||||
'keys' =>
|
||||
array(
|
||||
'id' => 'a',
|
||||
'secret' => 'b',
|
||||
),
|
||||
'scope' => 'c',
|
||||
'enabled' => '1',
|
||||
),
|
||||
'Foursquare' =>
|
||||
array(
|
||||
'keys' =>
|
||||
array(
|
||||
'id' => 'a',
|
||||
'secret' => 'b',
|
||||
),
|
||||
'enabled' => '1',
|
||||
),
|
||||
'Github' =>
|
||||
array(
|
||||
'keys' =>
|
||||
array(
|
||||
'id' => 'a',
|
||||
'secret' => 'b',
|
||||
),
|
||||
'scope' => 'c',
|
||||
'enabled' => '1',
|
||||
),
|
||||
'Google' =>
|
||||
array(
|
||||
'keys' =>
|
||||
array(
|
||||
'id' => 'a',
|
||||
'secret' => 'b',
|
||||
),
|
||||
'scope' => 'c',
|
||||
'enabled' => '1',
|
||||
),
|
||||
'LinkedIn' =>
|
||||
array(
|
||||
'keys' =>
|
||||
array(
|
||||
'id' => 'a',
|
||||
'secret' => 'b',
|
||||
),
|
||||
'enabled' => '1',
|
||||
),
|
||||
'Live' =>
|
||||
array(
|
||||
'keys' =>
|
||||
array(
|
||||
'id' => 'a',
|
||||
'secret' => 'b',
|
||||
),
|
||||
'enabled' => '1',
|
||||
),
|
||||
'OpenID' =>
|
||||
array(
|
||||
'enabled' => '1',
|
||||
),
|
||||
'Steam' =>
|
||||
array(
|
||||
'keys' =>
|
||||
array(
|
||||
'key' => 'a',
|
||||
),
|
||||
'enabled' => '1',
|
||||
),
|
||||
'Twitter' =>
|
||||
array(
|
||||
'keys' =>
|
||||
array(
|
||||
'key' => 'a',
|
||||
'secret' => 'b',
|
||||
),
|
||||
'enabled' => '1',
|
||||
),
|
||||
'Yahoo' =>
|
||||
array(
|
||||
'keys' =>
|
||||
array(
|
||||
'id' => 'a',
|
||||
'secret' => 'b',
|
||||
),
|
||||
'enabled' => '1',
|
||||
),
|
||||
);
|
Reference in New Issue
Block a user