MDL-18014 Atto autosave: Atto requires $PAGE->url be set or debugging is triggered

2 quiz tests are creating forms with text editors manually - they need to ensure a valid
$PAGE->url is set so they don't trigger debugging warnings from $PAGE->url magic method
called by Atto.
This commit is contained in:
Damyon Wiese 2014-08-19 16:02:14 +08:00
parent 9eea856632
commit d32bc7d655
2 changed files with 24 additions and 2 deletions

View file

@ -40,9 +40,12 @@ require_once(dirname(__FILE__) . '/../../../engine/tests/helpers.php');
*/
class qbehaviour_manualgraded_walkthrough_testcase extends qbehaviour_walkthrough_test_base {
public function test_manual_graded_essay() {
global $PAGE;
// The current text editor depends on the users profile setting - so it needs a valid user.
$this->setAdminUser();
// Required to init a text editor.
$PAGE->set_url('/');
// Create an essay question.
$essay = test_question_maker::make_an_essay_question();
@ -110,9 +113,12 @@ class qbehaviour_manualgraded_walkthrough_testcase extends qbehaviour_walkthroug
}
public function test_manual_graded_essay_not_answered() {
global $PAGE;
// The current text editor depends on the users profile setting - so it needs a valid user.
$this->setAdminUser();
// Required to init a text editor.
$PAGE->set_url('/');
// Create an essay question.
$essay = test_question_maker::make_an_essay_question();
@ -273,9 +279,12 @@ class qbehaviour_manualgraded_walkthrough_testcase extends qbehaviour_walkthroug
}
public function test_manual_graded_essay_can_grade_0() {
global $PAGE;
// The current text editor depends on the users profile setting - so it needs a valid user.
$this->setAdminUser();
// Required to init a text editor.
$PAGE->set_url('/');
// Create an essay question.
$essay = test_question_maker::make_an_essay_question();
@ -322,9 +331,12 @@ class qbehaviour_manualgraded_walkthrough_testcase extends qbehaviour_walkthroug
public function test_manual_graded_respects_display_options() {
// This test is for MDL-43874. Manual comments were not respecting the
// Display options for feedback.
global $PAGE;
// The current text editor depends on the users profile setting - so it needs a valid user.
$this->setAdminUser();
// Required to init a text editor.
$PAGE->set_url('/');
// Create an essay question.
$essay = test_question_maker::make_an_essay_question();