You are here

final class CoreExtensionsUnitTestSuite in Drupal driver for SQL Server and SQL Azure 4.1.x

Same name and namespace in other branches
  1. 4.2.x dev/TestSuites/CoreExtensionsUnitTestSuite.php \Drupal\Tests\sqlsrv\TestSuites\CoreExtensionsUnitTestSuite
  2. 3.0.x dev/travis/TestSuites/CoreExtensionsUnitTestSuite.php \Drupal\Tests\sqlsrv\TestSuites\CoreExtensionsUnitTestSuite
  3. 3.1.x dev/travis/TestSuites/CoreExtensionsUnitTestSuite.php \Drupal\Tests\sqlsrv\TestSuites\CoreExtensionsUnitTestSuite
  4. 4.0.x dev/travis/TestSuites/CoreExtensionsUnitTestSuite.php \Drupal\Tests\sqlsrv\TestSuites\CoreExtensionsUnitTestSuite

Discovers tests for the kernel test suite.

Hierarchy

Expanded class hierarchy of CoreExtensionsUnitTestSuite

File

dev/TestSuites/CoreExtensionsUnitTestSuite.php, line 12

Namespace

Drupal\Tests\sqlsrv\TestSuites
View source
final class CoreExtensionsUnitTestSuite extends TestSuiteBase {

  /**
   * Factory method which loads up a suite with all kernel tests.
   *
   * @return static
   *   The test suite.
   */
  public static function suite() {
    $root = self::getDrupalRoot();
    $suite = new static('unit');
    $suite
      ->addExtensionTestsBySuiteNamespace($root, 'Unit', '');
    return $suite;
  }

  /**
   * {@inheritdoc}
   */
  protected function addExtensionTestsBySuiteNamespace($root, $suite_namespace, $pattern) {
    foreach ($this
      ->findExtensionDirectories($root) as $extension_name => $dir) {
      $test_path = "{$dir}/tests/src/{$suite_namespace}";
      if (is_dir($test_path)) {
        $this
          ->addTestFiles(TestDiscovery::scanDirectory("Drupal\\Tests\\{$extension_name}\\{$suite_namespace}\\", $test_path));
      }
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CoreExtensionsUnitTestSuite::addExtensionTestsBySuiteNamespace protected function Find and add tests to the suite for core and any extensions. Overrides TestSuiteBase::addExtensionTestsBySuiteNamespace
CoreExtensionsUnitTestSuite::suite public static function Factory method which loads up a suite with all kernel tests.
TestSuiteBase::$failingClasses protected property The failing test files.
TestSuiteBase::addCoreKernelTestsByName protected function Find and add tests to the suite for core and any extensions.
TestSuiteBase::addExtensionTestsBySuiteNamespaceAndChunk protected function Find and add tests to the suite for core and any extensions.
TestSuiteBase::findExtensionDirectories protected function Finds extensions in a Drupal installation.
TestSuiteBase::getCoreExtensionSuite public static function Fetch a subset of the Core Extension tests.
TestSuiteBase::getDrupalRoot protected static function Get the path to webroot.