MDL-39507 qtype_essay: hacky fix for unit tests
authorDan Poltawski <dan@moodle.com>
Tue, 13 Aug 2013 02:46:10 +0000 (10:46 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 13 Aug 2013 02:47:19 +0000 (10:47 +0800)
This is just to get the tests passing for integration purposes. Tim
may want to do a robust fix and revert this.

question/behaviour/manualgraded/tests/walkthrough_test.php
question/type/essay/tests/question_test.php

index 5510070..8916805 100644 (file)
@@ -56,7 +56,7 @@ class qbehaviour_manualgraded_walkthrough_test extends qbehaviour_walkthrough_te
                 $this->get_does_not_contain_feedback_expectation());
 
         // Simulate some data submitted by the student.
-        $this->process_submission(array('answer' => 'This is my wonderful essay!'));
+        $this->process_submission(array('answer' => 'This is my wonderful essay!', 'answerformat' => FORMAT_PLAIN));
 
         // Verify.
         $this->check_current_state(question_state::$complete);
@@ -68,7 +68,7 @@ class qbehaviour_manualgraded_walkthrough_test extends qbehaviour_walkthrough_te
 
         // Process the same data again, check it does not create a new step.
         $numsteps = $this->get_step_count();
-        $this->process_submission(array('answer' => 'This is my wonderful essay!'));
+        $this->process_submission(array('answer' => 'This is my wonderful essay!', 'answerformat' => FORMAT_PLAIN));
         $this->check_step_count($numsteps);
 
         // Process different data, check it creates a new step.
@@ -77,7 +77,7 @@ class qbehaviour_manualgraded_walkthrough_test extends qbehaviour_walkthrough_te
         $this->check_current_state(question_state::$todo);
 
         // Change back, check it creates a new step.
-        $this->process_submission(array('answer' => 'This is my wonderful essay!'));
+        $this->process_submission(array('answer' => 'This is my wonderful essay!', 'answerformat' => FORMAT_PLAIN));
         $this->check_step_count($numsteps + 2);
 
         // Finish the attempt.
@@ -206,7 +206,7 @@ class qbehaviour_manualgraded_walkthrough_test extends qbehaviour_walkthrough_te
         $this->check_current_mark(null);
 
         // Simulate some data submitted by the student.
-        $this->process_submission(array('answer' => 'This is my wonderful essay!'));
+        $this->process_submission(array('answer' => 'This is my wonderful essay!', 'answerformat' => FORMAT_PLAIN));
 
         // Verify.
         $this->check_current_state(question_state::$complete);
@@ -283,7 +283,7 @@ class qbehaviour_manualgraded_walkthrough_test extends qbehaviour_walkthrough_te
                 $this->get_does_not_contain_feedback_expectation());
 
         // Simulate some data submitted by the student.
-        $this->process_submission(array('answer' => 'This is my wonderful essay!'));
+        $this->process_submission(array('answer' => 'This is my wonderful essay!', 'answerformat' => FORMAT_PLAIN));
 
         // Verify.
         $this->check_current_state(question_state::$complete);
index 2420162..856619b 100644 (file)
@@ -47,7 +47,7 @@ class qtype_essay_question_test extends advanced_testcase {
         $longstring = str_repeat('0123456789', 50);
         $essay = test_question_maker::make_an_essay_question();
         $this->assertEquals($longstring,
-                $essay->summarise_response(array('answer' => $longstring)));
+                $essay->summarise_response(array('answer' => $longstring, 'answerformat' => FORMAT_PLAIN)));
     }
 
     public function test_is_same_response() {