MDL-47538 phpunit: fix invalid PHPUNIT_SEQUENCE_START constant
This commit is contained in:
@@ -467,7 +467,10 @@ class phpunit_util extends testing_util {
|
||||
$sequencestart = 100000 + mt_rand(0, 99) * 1000;
|
||||
|
||||
$data = preg_replace('|<!--@plugin_suites_start@-->.*<!--@plugin_suites_end@-->|s', $suites, $data, 1);
|
||||
$data = preg_replace('|<!--@PHPUNIT_SEQUENCE_START@-->|s', $sequencestart, $data, 1);
|
||||
$data = str_replace(
|
||||
'<const name="PHPUNIT_SEQUENCE_START" value=""/>',
|
||||
'<const name="PHPUNIT_SEQUENCE_START" value="' . $sequencestart . '"/>',
|
||||
$data);
|
||||
|
||||
$result = false;
|
||||
if (is_writable($CFG->dirroot)) {
|
||||
@@ -523,7 +526,10 @@ class phpunit_util extends testing_util {
|
||||
|
||||
// Apply it to the file template
|
||||
$fcontents = str_replace('<!--@component_suite@-->', $ctemplate, $ftemplate);
|
||||
$fcontents = preg_replace('|<!--@PHPUNIT_SEQUENCE_START@-->|s', $sequencestart, $fcontents, 1);
|
||||
$fcontents = str_replace(
|
||||
'<const name="PHPUNIT_SEQUENCE_START" value=""/>',
|
||||
'<const name="PHPUNIT_SEQUENCE_START" value="' . $sequencestart . '"/>',
|
||||
$fcontents);
|
||||
|
||||
// fix link to schema
|
||||
$level = substr_count(str_replace('\\', '/', $cpath), '/') - substr_count(str_replace('\\', '/', $CFG->dirroot), '/');
|
||||
|
||||
Reference in New Issue
Block a user