MDL-67169 phpunit: fix clear flaw in unit test provider
Basically the provider is ignoring the CRLF to LF normalization results and loading the original file again. This doesn't have any impact normally, because all moodle files are LF ones and people using other systems have their git configurations set to work that way (not modify or force LF). But there may be checkouts out there (for example travis) where the git configuration by defult is to convert to the OS, causing windows runs to fail badly there. See the issue for more info and links.
This commit is contained in:
@@ -111,7 +111,7 @@ class core_messageinbound_testcase extends advanced_testcase {
|
||||
// Break on the --[TOKEN]-- tags in the file.
|
||||
$content = file_get_contents($file->getRealPath());
|
||||
$content = preg_replace("#\r\n#", "\n", $content);
|
||||
$tokens = preg_split('#(?:^|\n*)----([A-Z]+)----\n#', file_get_contents($file->getRealPath()),
|
||||
$tokens = preg_split('#(?:^|\n*)----([A-Z]+)----\n#', $content,
|
||||
null, PREG_SPLIT_DELIM_CAPTURE);
|
||||
$sections = array(
|
||||
// Key => Required.
|
||||
|
||||
Reference in New Issue
Block a user