Unit tests MDL-24992 Fixed mod/wiki unit test CRLF issue

This commit is contained in:
Sam Marshall 2010-11-01 18:04:26 +00:00
parent bf81b16824
commit cf72c96949

View File

@ -62,12 +62,15 @@ class wikiparser_test extends UnitTestCase {
if(!file_exists($this->test_directory."input/$markup/$num") || !file_exists($this->test_directory."output/$markup/$num")) {
return false;
}
$input = file_get_contents($this->test_directory."input/$markup/$num");
$output = file_get_contents($this->test_directory."output/$markup/$num");
$result = wiki_parser_proxy::parse($input, $markup, array('pretty_print' => true));
//removes line breaks to avoid line break encoding causing tests to fail.
$result['parsed_text'] = ereg_replace("[\r\n]", '', $result['parsed_text']);
$output = ereg_replace("[\r\n]", '', $output);
$this->assertEqual($result['parsed_text'], $output);
return true;
}