Skip to content

Commit

Permalink
Process module names in a case-insentive matter
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Apr 22, 2024
1 parent b13dd02 commit 556d697
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/TestCase/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function invokeTest(): void
$available = $this->getAvailable();

foreach ($this->parsed as $module) {
if (in_array($module, $available)) {
if (in_array(strtolower($module), $available)) {
$state = State::OK;
break 1;
}
Expand Down
3 changes: 2 additions & 1 deletion src/TestConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ private function getAvailableApacheModulesCgi(): array
*/
private function setAvailablePhpModules(): void
{
$this->availablePhpModules = array_merge(get_loaded_extensions(), get_loaded_extensions(true));
$availablePhpModules = array_merge(get_loaded_extensions(), get_loaded_extensions(true));
$this->availablePhpModules = array_map('strtolower', $availablePhpModules);
}


Expand Down
10 changes: 5 additions & 5 deletions src/TestSuite/Modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Modules extends \SimpleSAML\Module\monitor\TestSuiteFactory
private array $storePhpDependencies = [
'memcache' => 'memcached|memcache',
'phpsession' => 'session',
'sql' => 'PDO'
'sql' => 'pdo'
];

/** @var array */
Expand All @@ -45,13 +45,13 @@ class Modules extends \SimpleSAML\Module\monitor\TestSuiteFactory
'authYubiKey' => 'curl',
// TODO: consent only requires pdo when database backend is used..
// Should probably add this to required-list when processing metadata
// 'consent' => 'PDO',
'consentAdmin' => 'PDO',
// 'consent' => 'pdo',
'consentAdmin' => 'pdo',
'ldap' => 'ldap',
'ldapRadius' => ['ldap'],
'memcacheMonitor' => 'memcached|memcache',
'negotiate' => 'krb5',
'sqlauth' => 'PDO'
'sqlauth' => 'pdo'
];


Expand Down Expand Up @@ -79,7 +79,7 @@ protected function initialize(TestData $testData = null): void
private function addRequiredApacheModule(string $module): void
{
if (!in_array($module, $this->requiredApacheModules)) {
$this->requiredApacheModules[] = $module;
$this->requiredApacheModules[] = strtolower($module);
}
}

Expand Down

0 comments on commit 556d697

Please sign in to comment.