diff core/tests/TestSuites/TestSuiteBase.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children
line wrap: on
line diff
--- a/core/tests/TestSuites/TestSuiteBase.php	Mon Apr 23 09:33:26 2018 +0100
+++ b/core/tests/TestSuites/TestSuiteBase.php	Mon Apr 23 09:46:53 2018 +0100
@@ -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 @@
     // 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"));