Skip to content
Snippets Groups Projects
Unverified Commit 449b333d authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3114041 by swatichouhan012, longwave, chr.fritsch, alexpott, mondrake:...

Issue #3114041 by swatichouhan012, longwave, chr.fritsch, alexpott, mondrake: PhpUnit 8 tests breaking because of compatibility issue with setUp()
parent e8a6b798
No related branches found
No related tags found
No related merge requests found
......@@ -43,9 +43,14 @@ public static function mutateTestBase($autoloader) {
$alteredCode = file_get_contents($alteredFile = $vendor_dir . '/phpunit/phpunit/src/Framework/TestCase.php');
$alteredCode = preg_replace('/^ ((?:protected|public)(?: static)? function \w+\(\)): void/m', ' $1', $alteredCode);
$alteredCode = str_replace("__DIR__ . '/../Util/", "'$vendor_dir/phpunit/phpunit/src/Util/", $alteredCode);
$filename = __DIR__ . '/../../../../../../sites/simpletest/TestCase.php';
$simpletest_directory = __DIR__ . '/../../../../../../sites/simpletest';
// Only write when necessary.
$filename = $simpletest_directory . '/TestCase.php';
if (!file_exists($filename) || md5_file($filename) !== md5($alteredCode)) {
// Create directory when necessary.
if (!file_exists($simpletest_directory)) {
mkdir($simpletest_directory, 0777, TRUE);
}
file_put_contents($filename, $alteredCode);
}
include $filename;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment