1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-23 17:34:56 +02:00

MDL-72590 enrol: Course in success message after unenroll passes filter

This commit is contained in:
Luca Bösch 2021-09-15 20:37:03 +02:00
parent 385938b472
commit ce96fcc06a
2 changed files with 22 additions and 1 deletions

@ -127,3 +127,23 @@ Feature: Users can auto-enrol themself in courses where self enrolment is allowe
When I click on "//a[@data-action='unenrol']" "xpath_element" in the "student1" "table_row"
And I click on "Unenrol" "button" in the "Unenrol" "dialogue"
Then I should not see "Student 1" in the "participants" "table"
@javascript
Scenario: Self unenrol as a self-enrolled student from the course
Given the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
And I am on the "C1" "Course" page logged in as "teacher1"
When I add "Self enrolment" enrolment method with:
| Custom instance name | Test student enrolment |
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
And I set the field "Course full name" in the "General" "fieldset" to "<span lang=\"en\" class=\"multilang\">Course</span><span lang=\"it\" class=\"multilang\">Corso</span> 1"
And I press "Save and display"
And I log out
And I am on the "C1" "Course" page logged in as "student1"
And I press "Enrol me"
And I should see "You are enrolled in the course"
And I am on the "C1" "course" page
And I navigate to "Unenrol me from C1" in current page administration
And I click on "Continue" "button" in the "Confirm" "dialogue"
Then I should see "You are unenrolled from the course \"Course 1\""

@ -50,7 +50,8 @@ $PAGE->set_title($plugin->get_instance_name($instance));
if ($confirm and confirm_sesskey()) {
$plugin->unenrol_user($instance, $USER->id);
\core\notification::success(get_string('youunenrolledfromcourse', 'enrol', $course->fullname));
\core\notification::success(get_string('youunenrolledfromcourse', 'enrol', format_string($course->fullname, true,
["context" => $context])));
redirect(new moodle_url('/index.php'));
}