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:
@@ -101,9 +101,9 @@ class qbehaviour_missing_test extends advanced_testcase {
|
||||
$this->assertEquals(array('-submit' => '1', 'choice0' => '1'), $step->get_all_data());
|
||||
|
||||
$output = $qa->render(new question_display_options(), '1');
|
||||
$this->assertRegExp('/' . preg_quote($qa->get_question()->questiontext) . '/', $output);
|
||||
$this->assertRegExp('/' . preg_quote($qa->get_question()->questiontext, '/') . '/', $output);
|
||||
$this->assertRegExp('/' . preg_quote(
|
||||
get_string('questionusedunknownmodel', 'qbehaviour_missing')) . '/', $output);
|
||||
get_string('questionusedunknownmodel', 'qbehaviour_missing'), '/') . '/', $output);
|
||||
$this->assertTag(array('tag'=>'div', 'attributes'=>array('class'=>'warning')), $output);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user