diff --git a/core/lib/Drupal/Core/Test/JUnitConverter.php b/core/lib/Drupal/Core/Test/JUnitConverter.php index db4f88b2cd..65fdf165d2 100644 --- a/core/lib/Drupal/Core/Test/JUnitConverter.php +++ b/core/lib/Drupal/Core/Test/JUnitConverter.php @@ -68,7 +68,7 @@ public static function findTestCases(\SimpleXMLElement $element, \SimpleXMLEleme if ($file && !$child->attributes()->file) { $child->addAttribute('file', $file); } - $test_cases = array_merge($test_cases, simpletest_phpunit_find_testcases($child, $element)); + $test_cases = array_merge($test_cases, static::findTestCases($child, $element)); } } return $test_cases; diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index 35303b4e24..11f89c5ae6 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -183,9 +183,12 @@ function simpletest_run_tests($test_list) { * * @deprecated in Drupal 8.6.x, will be removed before 9.0.0. Use * \Drupal\Core\Test\PhpUnitTestRunner::runTests(). + * + * @see https://www.drupal.org/node/2948547 */ function simpletest_run_phpunit_tests($test_id, array $unescaped_test_classnames, &$status = NULL) { $runner = PhpUnitTestRunner::create(\Drupal::getContainer()); + @trigger_error(__FUNCTION__ . ' is deprecated. Use \Drupal\Core\Test\PhpUnitTestRunner::runTests() instead. https://www.drupal.org/node/2948547', E_USER_DEPRECATED); return $runner->runTests($test_id, $unescaped_test_classnames, $status); } @@ -262,9 +265,12 @@ function simpletest_summarize_phpunit_result($results) { * * @deprecated in Drupal 8.6.x, will be removed before 9.0.0. Use * \Drupal\Core\Test\PhpUnitTestRunner::xmlLogFilepath(). + * + * @see https://www.drupal.org/node/2948547 */ function simpletest_phpunit_xml_filepath($test_id) { $runner = PhpUnitTestRunner::create(\Drupal::getContainer()); + @trigger_error(__FUNCTION__ . ' is deprecated. Use \Drupal\Core\Test\PhpUnitTestRunner::xmlLogFilepath() instead. https://www.drupal.org/node/2948547', E_USER_DEPRECATED); return $runner->xmlLogFilePath($test_id); } @@ -304,9 +310,12 @@ function simpletest_phpunit_configuration_filepath() { * * @deprecated in Drupal 8.6.x, will be removed before 9.0.0. Use * \Drupal\Core\Test\PhpUnitTestRunner::runCommand(). + * + * @see https://www.drupal.org/node/2948547 */ 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. Use \Drupal\Core\Test\PhpUnitTestRunner::runCommand() instead. https://www.drupal.org/node/2948547', E_USER_DEPRECATED); return $runner->runCommand($unescaped_test_classnames, $phpunit_file, $status, $output); } @@ -318,9 +327,12 @@ function simpletest_phpunit_run_command(array $unescaped_test_classnames, $phpun * * @deprecated in Drupal 8.6.x, will be removed before 9.0.0. Use * \Drupal\Core\Test\PhpUnitTestRunner::phpUnitCommand(). + * + * @see https://www.drupal.org/node/2948547 */ function simpletest_phpunit_command() { $runner = PhpUnitTestRunner::create(\Drupal::getContainer()); + @trigger_error(__FUNCTION__ . ' is deprecated. Use \Drupal\Core\Test\PhpUnitTestRunner::phpUnitCommand() instead. https://www.drupal.org/node/2948547', E_USER_DEPRECATED); return $runner->phpUnitCommand(); } @@ -346,7 +358,8 @@ function _simpletest_batch_operation($test_list_init, $test_id, &$context) { // Perform the next test. $test_class = array_shift($test_list); if (is_subclass_of($test_class, TestCase::class)) { - $phpunit_results = simpletest_run_phpunit_tests($test_id, [$test_class]); + $runner = PhpUnitTestRunner::create(\Drupal::getContainer()); + $phpunit_results = $runner->runTests($test_id, [$test_class]); simpletest_process_phpunit_results($phpunit_results); $test_results[$test_class] = simpletest_summarize_phpunit_result($phpunit_results)[$test_class]; } @@ -704,8 +717,11 @@ function simpletest_mail_alter(&$message) { * * @deprecated in Drupal 8.6.x, will be removed before 9.0.0. Use * \Drupal\Core\Test\JUnitConverter::xmlToRows(). + * + * @see https://www.drupal.org/node/2948547 */ function simpletest_phpunit_xml_to_rows($test_id, $phpunit_xml_file) { + @trigger_error(__FUNCTION__ . ' is deprecated. Use \Drupal\Core\Test\JUnitConverter::xmlToRows() instead. https://www.drupal.org/node/2948547', E_USER_DEPRECATED); return JUnitConverter::xmlToRows($test_id, $phpunit_xml_file); } @@ -722,8 +738,11 @@ function simpletest_phpunit_xml_to_rows($test_id, $phpunit_xml_file) { * * @deprecated in Drupal 8.6.x, will be removed before 9.0.0. Use * \Drupal\Core\Test\JUnitConverter::findTestCases(). + * + * @see https://www.drupal.org/node/2948547 */ function simpletest_phpunit_find_testcases(\SimpleXMLElement $element, \SimpleXMLElement $parent = NULL) { + @trigger_error(__FUNCTION__ . ' is deprecated. Use \Drupal\Core\Test\JUnitConverter::findTestCases() instead. https://www.drupal.org/node/2948547', E_USER_DEPRECATED); return JUnitConverter::findTestCases($element, $parent); } @@ -740,7 +759,10 @@ function simpletest_phpunit_find_testcases(\SimpleXMLElement $element, \SimpleXM * * @deprecated in Drupal 8.6.x, will be removed before 9.0.0. Use * \Drupal\Core\Test\JUnitConverter::convertTestCaseToSimpletestRow(). + * + * @see https://www.drupal.org/node/2948547 */ function simpletest_phpunit_testcase_to_row($test_id, \SimpleXMLElement $test_case) { + @trigger_error(__FUNCTION__ . ' is deprecated. Use \Drupal\Core\Test\JUnitConverter::convertTestCaseToSimpletestRow() instead. https://www.drupal.org/node/2948547', E_USER_DEPRECATED); return JUnitConverter::convertTestCaseToSimpletestRow($test_id, $test_case); } diff --git a/core/modules/simpletest/src/Tests/UiPhpUnitOutputTest.php b/core/modules/simpletest/src/Tests/UiPhpUnitOutputTest.php index e032cef941..03523a15ed 100644 --- a/core/modules/simpletest/src/Tests/UiPhpUnitOutputTest.php +++ b/core/modules/simpletest/src/Tests/UiPhpUnitOutputTest.php @@ -9,6 +9,7 @@ * Test PHPUnit output for the Simpletest UI. * * @group simpletest + * @group legacy * * @see \Drupal\Tests\Listeners\SimpletestUiPrinter */ diff --git a/core/modules/simpletest/tests/src/Unit/PhpUnitErrorTest.php b/core/modules/simpletest/tests/src/Unit/PhpUnitErrorTest.php index 25211fc404..4fdb45d010 100644 --- a/core/modules/simpletest/tests/src/Unit/PhpUnitErrorTest.php +++ b/core/modules/simpletest/tests/src/Unit/PhpUnitErrorTest.php @@ -8,6 +8,7 @@ * Tests PHPUnit errors are getting converted to Simpletest errors. * * @group simpletest + * @group legacy */ class PhpUnitErrorTest extends UnitTestCase { diff --git a/core/modules/simpletest/tests/src/Unit/SimpletestPhpunitRunCommandTest.php b/core/modules/simpletest/tests/src/Unit/SimpletestPhpunitRunCommandTest.php index fec92c6043..1ca7ec7b95 100644 --- a/core/modules/simpletest/tests/src/Unit/SimpletestPhpunitRunCommandTest.php +++ b/core/modules/simpletest/tests/src/Unit/SimpletestPhpunitRunCommandTest.php @@ -22,6 +22,7 @@ * what happens. * * @group simpletest + * @group legacy * * @runTestsInSeparateProcesses */