You are here

function simpletest_phpunit_run_command in Drupal 8

Executes the PHPUnit command.

Parameters

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

string $phpunit_file: A filepath to use for PHPUnit's --log-junit option.

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

string $output: (optional) The output by running the phpunit command.

Return value

string The results as returned by exec().

Deprecated

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

See also

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

1 call to simpletest_phpunit_run_command()
UiPhpUnitOutputTest::testOutput in core/modules/simpletest/src/Tests/UiPhpUnitOutputTest.php
Tests that PHPUnit output in the Simpletest UI looks good.

File

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

Code

function simpletest_phpunit_run_command(array $unescaped_test_classnames, $phpunit_file, &$status = NULL, &$output = 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::runCommand() instead. See https://www.drupal.org/node/2948547', E_USER_DEPRECATED);
  return $runner
    ->runCommand($unescaped_test_classnames, $phpunit_file, $status, $output);
}