You are here

CoreExtensionsUnitTestSuite.php in Drupal driver for SQL Server and SQL Azure 3.1.x

File

dev/travis/TestSuites/CoreExtensionsUnitTestSuite.php
View source
<?php

namespace Drupal\Tests\sqlsrv\TestSuites;

use Drupal\Core\Test\TestDiscovery;
require_once __DIR__ . '/TestSuiteBase.php';

/**
 * Discovers tests for the kernel test suite.
 */
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 = dirname(__DIR__, 6);
    $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));
      }
    }
  }

}

Classes

Namesort descending Description
CoreExtensionsUnitTestSuite Discovers tests for the kernel test suite.