MDL-49232 enrol_self: Adapting unit test to new can_self_enrol() output
authorDavid Monllao <davidm@moodle.com>
Fri, 1 May 2015 07:43:09 +0000 (15:43 +0800)
committerDavid Monllao <davidm@moodle.com>
Fri, 1 May 2015 07:43:09 +0000 (15:43 +0800)
enrol/self/tests/self_test.php

index 9338a39..b4250c0 100644 (file)
@@ -576,7 +576,7 @@ class enrol_self_testcase extends advanced_testcase {
      * This will check user enrolment only, rest has been tested in test_show_enrolme_link.
      */
     public function test_can_self_enrol() {
-        global $DB, $CFG;
+        global $DB, $CFG, $OUTPUT;
         $this->resetAfterTest();
         $this->preventResetByRollback();
 
@@ -602,7 +602,8 @@ class enrol_self_testcase extends advanced_testcase {
         $selfplugin->enrol_user($instance1, $user2->id, $editingteacherrole->id);
 
         $this->setUser($guest);
-        $this->assertSame(get_string('noguestaccess', 'enrol'), $selfplugin->can_self_enrol($instance1, true));
+        $noaccesshtml = get_string('noguestaccess', 'enrol') . $OUTPUT->continue_button(get_login_url());
+        $this->assertSame($noaccesshtml, $selfplugin->can_self_enrol($instance1, true));
 
         $this->setUser($user1);
         $this->assertTrue($selfplugin->can_self_enrol($instance1, true));