Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Mile23 on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.8.x
Introduced in version:
8.8.0
Issue links:
Description:
As part of the ongoing work to isolate the test infrastructure from the simpletest module, simpletest's PHPUnit and JUnit functions are now refactored to classes in the Drupal\Core\Test
namespace.
The functions themselves are deprecated for removal before Drupal 9.0.0.
The methods which replace them are marked @internal
, so contrib should not rely on them as an API. Their behaviors are being kept so that core can continue to use run-tests.sh
, and will likely change over time.
These functions are replaced by methods on two utility classes:
\Drupal\Core\Test\PhpUnitTestRunner
\Drupal\Core\Test\JUnitConverter
Replace them this way:
- Deprecated function -> New method
simpletest_run_phpunit_tests()
->PhpUnitTestRunner::runTests()
simpletest_phpunit_xml_filepath()
->PhpUnitTestRunner::xmlLogFilePath()
simpletest_phpunit_run_command()
->PhpUnitTestRunner::runCommand()
simpletest_phpunit_command()
->PhpUnitTestRunner::phpUnitCommand()
simpletest_summarize_phpunit_result()
->PhpUnitTestRunner::summarizeResults()
simpletest_phpunit_xml_to_rows()
->JUnitConverter::xmlToRows()
simpletest_phpunit_find_testcases()
->JUnitConverter::findTestCases()
simpletest_phpunit_testcase_to_row()
->JUnitConverter::convertTestCaseToSimpletestRow()
Impacts:
Module developers