diff --git a/src/Core/CoreKernel.php b/src/Core/CoreKernel.php index fb958f8d2..d28a98692 100644 --- a/src/Core/CoreKernel.php +++ b/src/Core/CoreKernel.php @@ -516,7 +516,7 @@ class CoreKernel implements Kernel * * @return string[] List of CI types to ignore as defined by `Module`. */ - protected function getIgnoreCIConfigs(): array + protected function getIgnoredCIConfigs(): array { return []; } @@ -532,14 +532,14 @@ class CoreKernel implements Kernel $this->getClassLoader()->init( $this->getIncludeTests(), $flush, - $this->getIgnoreCIConfigs() + $this->getIgnoredCIConfigs() ); // Find modules $this->getModuleLoader()->init( $this->getIncludeTests(), $flush, - $this->getIgnoreCIConfigs() + $this->getIgnoredCIConfigs() ); // Flush config @@ -561,7 +561,7 @@ class CoreKernel implements Kernel $defaultSet->init( $this->getIncludeTests(), $flush, - $this->getIgnoreCIConfigs() + $this->getIgnoredCIConfigs() ); } } diff --git a/src/Core/Manifest/ClassManifest.php b/src/Core/Manifest/ClassManifest.php index 8167a6826..a09fd06d8 100644 --- a/src/Core/Manifest/ClassManifest.php +++ b/src/Core/Manifest/ClassManifest.php @@ -515,7 +515,7 @@ class ClassManifest 'name_regex' => '/^[^_].*\\.php$/', 'ignore_files' => ['index.php', 'cli-script.php'], 'ignore_tests' => !$includeTests, - 'ignore_ci_configs' => $ignoredCIConfigs, + 'ignored_ci_configs' => $ignoredCIConfigs, 'file_callback' => function ($basename, $pathname, $depth) use ($includeTests, $finder) { $this->handleFile($basename, $pathname, $includeTests); }, diff --git a/src/Core/Manifest/ManifestFileFinder.php b/src/Core/Manifest/ManifestFileFinder.php index 1007ba23f..46fa5ea09 100644 --- a/src/Core/Manifest/ManifestFileFinder.php +++ b/src/Core/Manifest/ManifestFileFinder.php @@ -6,13 +6,14 @@ use RuntimeException; use SilverStripe\Assets\FileFinder; /** - * An extension to the default file finder with some extra filters to faciliate + * An extension to the default file finder with some extra filters to facilitate * autoload and template manifest generation: * - Only modules with _config.php files are scanned. * - If a _manifest_exclude file is present inside a directory it is ignored. * - Assets and module language directories are ignored. - * - Module tests directories are skipped if the ignore_tests option is not - * set to false. + * - Module tests directories are skipped if either of these conditions is meant: + * - the `ignore_tests` option is not set to false. + * - the module PHP CI configuration matches one of the `ignored_ci_configs` */ class ManifestFileFinder extends FileFinder { @@ -34,7 +35,7 @@ class ManifestFileFinder extends FileFinder 'ignore_tests' => true, 'min_depth' => 1, 'ignore_dirs' => ['node_modules'], - 'ignore_ci_configs' => [] + 'ignored_ci_configs' => [] ]; public function acceptDir($basename, $pathname, $depth) @@ -76,9 +77,9 @@ class ManifestFileFinder extends FileFinder } // Skip if test dir inside vendor module with unexpected CI Configuration - if ($depth > 3 && $basename === self::TESTS_DIR && $ignoreCIConfig = $this->getOption('ignore_ci_configs')) { + if ($depth > 3 && $basename === self::TESTS_DIR && $ignoredCIConfig = $this->getOption('ignored_ci_configs')) { $ciLib = $this->findModuleCIPhpConfiguration($basename, $pathname, $depth); - if (in_array($ciLib, $ignoreCIConfig)) { + if (in_array($ciLib, $ignoredCIConfig)) { return false; } } diff --git a/src/Core/Manifest/ModuleManifest.php b/src/Core/Manifest/ModuleManifest.php index 75be570a9..3aca00e82 100644 --- a/src/Core/Manifest/ModuleManifest.php +++ b/src/Core/Manifest/ModuleManifest.php @@ -173,7 +173,7 @@ class ModuleManifest $finder->setOptions([ 'min_depth' => 0, 'ignore_tests' => !$includeTests, - 'ignore_ci_configs' => $ignoredCIConfigs, + 'ignored_ci_configs' => $ignoredCIConfigs, 'dir_callback' => function ($basename, $pathname, $depth) use ($finder) { if ($finder->isDirectoryModule($basename, $pathname, $depth)) { $this->addModule($pathname); diff --git a/src/Dev/SapphireTest.php b/src/Dev/SapphireTest.php index be9a0e221..ffcf459a0 100644 --- a/src/Dev/SapphireTest.php +++ b/src/Dev/SapphireTest.php @@ -1012,7 +1012,7 @@ if (class_exists(IsEqualCanonicalizing::class)) { $kernel = new TestKernel(BASE_PATH); // PHPUnit 9 only logic to exclude old test still targeting PHPUNit 5.7 - $kernel->setIgnoreCIConfigs([Module::CI_PHPUNIT_FIVE, Module::CI_UNKNOWN]); + $kernel->setIgnoredCIConfigs([Module::CI_PHPUNIT_FIVE, Module::CI_UNKNOWN]); if (class_exists(HTTPApplication::class)) { // Mock request diff --git a/src/Dev/TestKernel.php b/src/Dev/TestKernel.php index 1e7708680..3b4f9541d 100644 --- a/src/Dev/TestKernel.php +++ b/src/Dev/TestKernel.php @@ -51,15 +51,15 @@ class TestKernel extends CoreKernel * Set a list of CI configurations that should cause a module's test not to be added to a manifest * @param string[] $ciConfigs */ - public function setIgnoreCIConfigs(array $ciLibs): self + public function setIgnoredCIConfigs(array $ciConfigs): self { - $this->ciLibs = $ciLibs; + $this->ciConfigs = $ciConfigs; return $this; } - protected function getIgnoreCIConfigs(): array + protected function getIgnoredCIConfigs(): array { - return $this->ciLibs; + return $this->ciConfigs; } protected function bootErrorHandling() diff --git a/src/View/ThemeManifest.php b/src/View/ThemeManifest.php index 9c2818985..d68fb8d92 100644 --- a/src/View/ThemeManifest.php +++ b/src/View/ThemeManifest.php @@ -139,7 +139,7 @@ class ThemeManifest implements ThemeList 'include_themes' => false, 'ignore_dirs' => ['node_modules', THEMES_DIR], 'ignore_tests' => !$includeTests, - 'ignore_ci_configs' => $ignoredCIConfigs, + 'ignored_ci_configs' => $ignoredCIConfigs, 'dir_callback' => [$this, 'handleDirectory'] ]); diff --git a/tests/php/Core/Manifest/ManifestFileFinderTest.php b/tests/php/Core/Manifest/ManifestFileFinderTest.php index 4f90ed3aa..f39a1bbc1 100644 --- a/tests/php/Core/Manifest/ManifestFileFinderTest.php +++ b/tests/php/Core/Manifest/ManifestFileFinderTest.php @@ -91,7 +91,7 @@ class ManifestFileFinderTest extends SapphireTest $finder = new ManifestFileFinder(); $finder->setOption('name_regex', '/\.txt$/'); $finder->setOption('ignore_tests', false); - $finder->setOption('ignore_ci_configs', [Module::CI_PHPUNIT_FIVE]); + $finder->setOption('ignored_ci_configs', [Module::CI_PHPUNIT_FIVE]); $this->assertFinderFinds( $finder, @@ -115,7 +115,7 @@ class ManifestFileFinderTest extends SapphireTest $finder = new ManifestFileFinder(); $finder->setOption('name_regex', '/\.txt$/'); $finder->setOption('ignore_tests', false); - $finder->setOption('ignore_ci_configs', [Module::CI_PHPUNIT_FIVE, Module::CI_UNKNOWN]); + $finder->setOption('ignored_ci_configs', [Module::CI_PHPUNIT_FIVE, Module::CI_UNKNOWN]); $this->assertFinderFinds( $finder,