MDL-40493 question: set real $USER before testing question walktrough

This commit is contained in:
Petr Škoda 2013-10-08 23:21:34 +02:00 committed by Sam Hemelryk
parent ed661154de
commit c969753885
2 changed files with 10 additions and 0 deletions

View file

@ -41,6 +41,8 @@ require_once(dirname(__FILE__) . '/../../../engine/tests/helpers.php');
class qbehaviour_manualgraded_walkthrough_testcase extends qbehaviour_walkthrough_test_base {
public function test_manual_graded_essay() {
$this->setAdminUser();
// Create an essay question.
$essay = test_question_maker::make_an_essay_question();
$this->start_attempt_at_question($essay, 'deferredfeedback', 10);
@ -108,6 +110,8 @@ class qbehaviour_manualgraded_walkthrough_testcase extends qbehaviour_walkthroug
public function test_manual_graded_essay_not_answered() {
$this->setAdminUser();
// Create an essay question.
$essay = test_question_maker::make_an_essay_question();
$this->start_attempt_at_question($essay, 'deferredfeedback', 10);
@ -268,6 +272,8 @@ class qbehaviour_manualgraded_walkthrough_testcase extends qbehaviour_walkthroug
public function test_manual_graded_essay_can_grade_0() {
$this->setAdminUser();
// Create an essay question.
$essay = test_question_maker::make_an_essay_question();
$this->start_attempt_at_question($essay, 'deferredfeedback', 10);

View file

@ -74,6 +74,8 @@ class qtype_essay_walkthrough_testcase extends qbehaviour_walkthrough_test_base
public function test_deferred_feedback_html_editor() {
$this->setAdminUser();
// Create an essay question.
$q = test_question_maker::make_question('essay', 'editor');
$this->start_attempt_at_question($q, 'deferredfeedback', 1);
@ -178,6 +180,8 @@ class qtype_essay_walkthrough_testcase extends qbehaviour_walkthrough_test_base
public function test_responsetemplate() {
$this->setAdminUser();
// Create an essay question.
$q = test_question_maker::make_question('essay', 'responsetemplate');
$this->start_attempt_at_question($q, 'deferredfeedback', 1);