You are here

function simpletest_run_phpunit_tests in Drupal 8

Executes PHPUnit tests and returns the results of the run.

Parameters

$test_id: The current test ID.

$unescaped_test_classnames: An array of test class names, including full namespaces, to be passed as a regular expression to PHPUnit's --filter option.

int $status: (optional) The exit status code of the PHPUnit process will be assigned to this variable.

Return value

array The parsed results of PHPUnit's JUnit XML output, in the format of {simpletest}'s schema.

Deprecated

in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Test\PhpUnitTestRunner::runTests() instead.

See also

https://www.drupal.org/node/2948547

1 call to simpletest_run_phpunit_tests()
SimpletestPhpunitRunCommandTest::testSimpletestPhpUnitRunCommand in core/modules/simpletest/tests/src/Unit/SimpletestPhpunitRunCommandTest.php
Test the round trip for PHPUnit execution status codes.

File

core/modules/simpletest/simpletest.module, line 201
Provides testing functionality.

Code

function simpletest_run_phpunit_tests($test_id, array $unescaped_test_classnames, &$status = NULL) {
  $runner = PhpUnitTestRunner::create(\Drupal::getContainer());
  @trigger_error(__FUNCTION__ . ' is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \\Drupal\\Core\\Test\\PhpUnitTestRunner::runTests() instead. See https://www.drupal.org/node/2948547', E_USER_DEPRECATED);
  return $runner
    ->runTests($test_id, $unescaped_test_classnames, $status);
}