protected function TestSuiteBase::addExtensionTestsBySuiteNamespace in Drupal driver for SQL Server and SQL Azure 3.1.x
Same name in this branch
- 3.1.x dev/appveyor/TestSuites/TestSuiteBase.php \Drupal\Tests\sqlsrv\TestSuites\TestSuiteBase::addExtensionTestsBySuiteNamespace()
- 3.1.x dev/travis/TestSuites/TestSuiteBase.php \Drupal\Tests\sqlsrv\TestSuites\TestSuiteBase::addExtensionTestsBySuiteNamespace()
Same name and namespace in other branches
- 4.2.x dev/TestSuites/TestSuiteBase.php \Drupal\Tests\sqlsrv\TestSuites\TestSuiteBase::addExtensionTestsBySuiteNamespace()
- 3.0.x dev/appveyor/TestSuites/TestSuiteBase.php \Drupal\Tests\sqlsrv\TestSuites\TestSuiteBase::addExtensionTestsBySuiteNamespace()
- 3.0.x dev/travis/TestSuites/TestSuiteBase.php \Drupal\Tests\sqlsrv\TestSuites\TestSuiteBase::addExtensionTestsBySuiteNamespace()
- 4.0.x dev/appveyor/TestSuites/TestSuiteBase.php \Drupal\Tests\sqlsrv\TestSuites\TestSuiteBase::addExtensionTestsBySuiteNamespace()
- 4.0.x dev/travis/TestSuites/TestSuiteBase.php \Drupal\Tests\sqlsrv\TestSuites\TestSuiteBase::addExtensionTestsBySuiteNamespace()
- 4.1.x dev/TestSuites/TestSuiteBase.php \Drupal\Tests\sqlsrv\TestSuites\TestSuiteBase::addExtensionTestsBySuiteNamespace()
Find and add tests to the suite for core and any extensions.
Parameters
string $root: Path to the root of the Drupal installation.
string $suite_namespace: SubNamespace used to separate test suite. Examples: Unit, Functional.
string $pattern: REGEXP pattern to apply to file name.
File
- dev/
appveyor/ TestSuites/ TestSuiteBase.php, line 105
Class
- TestSuiteBase
- Base class for Drupal test suites.
Namespace
Drupal\Tests\sqlsrv\TestSuitesCode
protected function addExtensionTestsBySuiteNamespace($root, $suite_namespace, $pattern) {
$failing_classes = [];
foreach ($this->failingClasses as $failing_class) {
$failing_classes[] = $root . $failing_class;
}
// Extensions' tests will always be in the namespace
// Drupal\Tests\$extension_name\$suite_namespace\ and be in the
// $extension_path/tests/src/$suite_namespace directory. Not all extensions
// will have all kinds of tests.
foreach ($this
->findExtensionDirectories($root) as $extension_name => $dir) {
if (preg_match("#^{$pattern}(.*)\$#i", $extension_name) !== 0) {
$test_path = "{$dir}/tests/src/{$suite_namespace}";
if (is_dir($test_path)) {
$passing_tests = [];
$tests = TestDiscovery::scanDirectory("Drupal\\Tests\\{$extension_name}\\{$suite_namespace}\\", $test_path);
foreach ($tests as $test) {
if (!in_array($test, $failing_classes)) {
$passing_tests[] = $test;
}
}
$this
->addTestFiles($passing_tests);
}
}
}
}