MDL-37506 question code: incorrect preg_quote uses.
For preg_quote to work reliably, you must pass the delimiter you are using for your regular expression. In many places we were failing to do that.
This commit is contained in:
@@ -107,7 +107,7 @@ class qtype_missing_test extends question_testcase {
|
||||
$this->assertRegExp('/' .
|
||||
preg_quote($qa->get_question()->questiontext, '/') . '/', $output);
|
||||
$this->assertRegExp('/' .
|
||||
preg_quote(get_string('missingqtypewarning', 'qtype_missingtype')) . '/', $output);
|
||||
preg_quote(get_string('missingqtypewarning', 'qtype_missingtype'), '/') . '/', $output);
|
||||
$this->assert(new question_contains_tag_with_attribute(
|
||||
'div', 'class', 'warning missingqtypewarning'), $output);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user