Skip to content

Commit

Permalink
MDL-49232 enrol_self: Adapting unit test to new can_self_enrol() output
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed May 1, 2015
1 parent 84d83fe commit dc9b229
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions enrol/self/tests/self_test.php
Expand Up @@ -576,7 +576,7 @@ public function test_show_enrolme_link() {
* 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();

Expand All @@ -602,7 +602,8 @@ public function test_can_self_enrol() {
$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));
Expand Down

0 comments on commit dc9b229

Please sign in to comment.