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:
Tim Hunt
2013-01-18 11:18:54 +00:00
parent a5ec499521
commit 03cefcc91b
25 changed files with 73 additions and 73 deletions
@@ -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);
}
}