* 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();
$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));