MDL-37506 question code: incorrect preg_quote uses.
[moodle.git] / question / behaviour / deferredcbm / tests / walkthrough_test.php
index 852b068..69b7cd1 100644 (file)
@@ -101,7 +101,7 @@ class qbehaviour_deferredcbm_walkthrough_test extends qbehaviour_walkthrough_tes
         $this->check_current_state(question_state::$mangrpartial);
         $this->check_current_mark(1);
         $this->check_current_output(new question_pattern_expectation('/' .
-                preg_quote('Not good enough!') . '/'));
+                preg_quote('Not good enough!', '/') . '/'));
 
         // Now change the correct answer to the question, and regrade.
         $tf->rightanswer = false;
@@ -178,7 +178,7 @@ class qbehaviour_deferredcbm_walkthrough_test extends qbehaviour_walkthrough_tes
                 new question_pattern_expectation('/' . preg_quote(
                         get_string('assumingcertainty', 'qbehaviour_deferredcbm',
                         question_cbm::get_string(
-                            $qa->get_last_behaviour_var('_assumedcertainty')))) . '/'));
+                            $qa->get_last_behaviour_var('_assumedcertainty'))), '/') . '/'));
         $this->assertEquals(get_string('true', 'qtype_truefalse'),
                 $this->quba->get_response_summary($this->slot));
     }
@@ -204,9 +204,9 @@ class qbehaviour_deferredcbm_walkthrough_test extends qbehaviour_walkthrough_tes
                 $this->get_contains_incorrect_expectation());
         $this->assertEquals('A [' . question_cbm::get_string(question_cbm::HIGH) . ']',
                 $this->quba->get_right_answer_summary($this->slot));
-        $this->assertRegExp('/' . preg_quote($mc->questiontext) . '/',
+        $this->assertRegExp('/' . preg_quote($mc->questiontext, '/') . '/',
                 $this->quba->get_question_summary($this->slot));
-        $this->assertRegExp('/(B|C) \[' . preg_quote(question_cbm::get_string(2)) . '\]/',
+        $this->assertRegExp('/(B|C) \[' . preg_quote(question_cbm::get_string(2), '/') . '\]/',
                 $this->quba->get_response_summary($this->slot));
 
         // Save the old attempt.
@@ -228,7 +228,7 @@ class qbehaviour_deferredcbm_walkthrough_test extends qbehaviour_walkthrough_tes
                 $this->get_does_not_contain_correctness_expectation());
         $this->assertEquals('A [' . question_cbm::get_string(question_cbm::HIGH) . ']',
                 $this->quba->get_right_answer_summary($this->slot));
-        $this->assertRegExp('/' . preg_quote($mc->questiontext) . '/',
+        $this->assertRegExp('/' . preg_quote($mc->questiontext, '/') . '/',
                 $this->quba->get_question_summary($this->slot));
         $this->assertNull($this->quba->get_response_summary($this->slot));
 
@@ -243,7 +243,7 @@ class qbehaviour_deferredcbm_walkthrough_test extends qbehaviour_walkthrough_tes
                 $this->get_contains_mc_radio_expectation($rightindex, false, true),
                 $this->get_contains_cbm_radio_expectation(3, false, true),
                 $this->get_contains_correct_expectation());
-        $this->assertRegExp('/(A) \[' . preg_quote(question_cbm::get_string(3)) . '\]/',
+        $this->assertRegExp('/(A) \[' . preg_quote(question_cbm::get_string(3), '/') . '\]/',
                 $this->quba->get_response_summary($this->slot));
     }