MDL-49232 enrol_self: Adapting unit test to new can_self_enrol() output

This commit is contained in:
David Monllao
2015-05-01 15:43:09 +08:00
parent 84d83fe7e1
commit dc9b229d7a
+3 -2
View 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));