Skip to content

Commit

Permalink
N°7673 - fix hybridauth moved
Browse files Browse the repository at this point in the history
  • Loading branch information
odain-cbd committed Nov 26, 2024
1 parent ea02f04 commit fd89142
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
18 changes: 0 additions & 18 deletions src/Service/HybridauthService.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,4 @@ public function authenticate(string $sName)
$oAuthAdapter = $oHybridAuth->authenticate($sName);
return $oAuthAdapter;
}

public function ListProviders() : array {
$aList = [];
$sPath = __DIR__ . '/../../vendor/hybridauth/hybridauth/src/Provider/';
$oFilesystemIterator = new \FilesystemIterator($sPath);
/** @var \SplFileInfo $file */
foreach ($oFilesystemIterator as $file) {
if (!$file->isDir()) {
$sProvider = strtok($file->getFilename(), '.');
$sClass = sprintf('Hybridauth\\Provider\\%s', $sProvider);
$oReflectionClass = new \ReflectionClass($sClass);
if ($oReflectionClass->implementsInterface(AdapterInterface::class)) {
$aList [] = $sProvider;
}
}
}
return $aList;
}
}
8 changes: 1 addition & 7 deletions tests/php-unit-tests/Service/HybridauthServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ protected function setUp(): void {
parent::setUp();

$this->RequireOnceItopFile('env-production/combodo-hybridauth/vendor/autoload.php');
}

public function testListProviders() {
$oHybridauthService = new HybridauthService();
$aRes = $oHybridauthService->ListProviders();
$this->assertContains("Google", $aRes);
$this->assertContains("MicrosoftGraph", $aRes);
$this->RequireOnceItopFile('env-production/combodo-oauth2-client/vendor/autoload.php');

}
}

0 comments on commit fd89142

Please sign in to comment.