X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Ftests%2FTestSuites%2FTestSuiteBase.php;h=41ed61622b779da4006ec3cf758522519688a1ca;hb=refs%2Fheads%2Fd864;hp=82a13ba255744c1c9df11065107619e6eb43d95c;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/web/core/tests/TestSuites/TestSuiteBase.php b/web/core/tests/TestSuites/TestSuiteBase.php index 82a13ba25..41ed61622 100644 --- a/web/core/tests/TestSuites/TestSuiteBase.php +++ b/web/core/tests/TestSuites/TestSuiteBase.php @@ -3,11 +3,12 @@ namespace Drupal\Tests\TestSuites; use Drupal\simpletest\TestDiscovery; +use PHPUnit\Framework\TestSuite; /** * Base class for Drupal test suites. */ -abstract class TestSuiteBase extends \PHPUnit_Framework_TestSuite { +abstract class TestSuiteBase extends TestSuite { /** * Finds extensions in a Drupal installation. @@ -40,7 +41,13 @@ abstract class TestSuiteBase extends \PHPUnit_Framework_TestSuite { // always inside of core/tests/Drupal/${suite_namespace}Tests. The exception // to this is Unit tests for historical reasons. if ($suite_namespace == 'Unit') { - $this->addTestFiles(TestDiscovery::scanDirectory("Drupal\\Tests\\", "$root/core/tests/Drupal/Tests")); + $tests = TestDiscovery::scanDirectory("Drupal\\Tests\\", "$root/core/tests/Drupal/Tests"); + $tests = array_flip(array_filter(array_flip($tests), function ($test_class) { + // The Listeners directory does not contain tests. Use the class name + // to be compatible with all operating systems. + return !preg_match('/^Drupal\\\\Tests\\\\Listeners\\\\/', $test_class); + })); + $this->addTestFiles($tests); } else { $this->addTestFiles(TestDiscovery::scanDirectory("Drupal\\${suite_namespace}Tests\\", "$root/core/tests/Drupal/${suite_namespace}Tests"));