Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / simpletest / src / TestDiscovery.php
index 5374520e5645313fb6e3389a8ee6413467ce8104..9e6c32c327cffd3102d0ebf1b0d5a724be5c8c22 100644 (file)
@@ -144,8 +144,8 @@ class TestDiscovery {
    *   An array of tests keyed by the the group name.
    * @code
    *     $groups['block'] => array(
-   *       'Drupal\block\Tests\BlockTest' => array(
-   *         'name' => 'Drupal\block\Tests\BlockTest',
+   *       'Drupal\Tests\block\Functional\BlockTest' => array(
+   *         'name' => 'Drupal\Tests\block\Functional\BlockTest',
    *         'description' => 'Tests block UI CRUD functionality.',
    *         'group' => 'block',
    *       ),
@@ -189,14 +189,17 @@ class TestDiscovery {
         // abstract class, trait or test fixture.
         continue;
       }
-      // Skip this test class if it requires unavailable modules.
-      // @todo PHPUnit skips tests with unmet requirements when executing a test
-      //   (instead of excluding them upfront). Refactor test runner to follow
-      //   that approach.
+      // Skip this test class if it is a Simpletest-based test and requires
+      // unavailable modules. TestDiscovery should not filter out module
+      // requirements for PHPUnit-based test classes.
+      // @todo Move this behavior to \Drupal\simpletest\TestBase so tests can be
+      //       marked as skipped, instead.
       // @see https://www.drupal.org/node/1273478
-      if (!empty($info['requires']['module'])) {
-        if (array_diff($info['requires']['module'], $this->availableExtensions['module'])) {
-          continue;
+      if ($info['type'] == 'Simpletest') {
+        if (!empty($info['requires']['module'])) {
+          if (array_diff($info['requires']['module'], $this->availableExtensions['module'])) {
+            continue;
+          }
         }
       }
 
@@ -309,7 +312,7 @@ class TestDiscovery {
   /**
    * Retrieves information about a test class for UI purposes.
    *
-   * @param string $class
+   * @param string $classname
    *   The test classname.
    * @param string $doc_comment
    *   (optional) The class PHPDoc comment. If not passed in reflection will be