mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-43820 enrol_cohort: Override find_instance
For cohort enrol method we can have multiple instances. We can match those by cohort idnumber and role provided. Also adding some extra validation and update tests.
- Loading branch information
1 parent
b70c7b1
commit 93b2db2
Showing
9 changed files
with
222 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
shortname,fullname,category_idnumber,enrolment_1,enrolment_1_role,enrolment_1_cohortname | ||
shortname,fullname,category_idnumber,enrolment_1,enrolment_1_role,enrolment_1_cohortidnumber | ||
C1,Course 1,CAT1,cohort,student,Not exist | ||
C1,Course 1,CAT1,cohort,student,Cohort 3 | ||
C2,Course 2,CAT2,cohort,student,Cohort 4 | ||
C3,Course 3,CAT1,cohort,student,Cohort 5 | ||
C1,Course 1,CAT1,cohort,student,CV3 | ||
C2,Course 2,CAT2,cohort,student,CV4 | ||
C3,Course 3,CAT1,cohort,student,CV5 | ||
C4,Course 3,CAT1,cohort,student1,CV6 |
6 changes: 3 additions & 3 deletions
6
admin/tool/uploadcourse/tests/fixtures/enrolment_cohort_addtogroup.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
shortname,fullname,category_idnumber,enrolment_1,enrolment_1_role,enrolment_1_cohortname,enrolment_1_addtogroup | ||
C2,Course 2,CAT2,cohort,student,Cohort 2,1 | ||
C3,Course 3,CAT1,cohort,student,Cohort 1,0 | ||
shortname,fullname,category_idnumber,enrolment_1,enrolment_1_role,enrolment_1_cohortidnumber,enrolment_1_addtogroup | ||
C2,Course 2,CAT2,cohort,student,CV2,1 | ||
C3,Course 3,CAT1,cohort,student,CV1,0 |
4 changes: 2 additions & 2 deletions
4
admin/tool/uploadcourse/tests/fixtures/enrolment_cohort_addtogroup_groupname.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
shortname,fullname,category_idnumber,enrolment_1,enrolment_1_role,enrolment_1_cohortname,enrolment_1_addtogroup,enrolment_1_groupname | ||
C1,Course 1,CAT1,cohort,student,Cohort 1,0,group1 | ||
shortname,fullname,category_idnumber,enrolment_1,enrolment_1_role,enrolment_1_cohortidnumber,enrolment_1_addtogroup,enrolment_1_groupname | ||
C1,Course 1,CAT1,cohort,student,CV1,0,group1 |
6 changes: 3 additions & 3 deletions
6
admin/tool/uploadcourse/tests/fixtures/enrolment_cohort_groups.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
shortname,fullname,category_idnumber,enrolment_1,enrolment_1_role,enrolment_1_cohortname,enrolment_1_groupname | ||
C1,Course 1,CAT1,cohort,student,Cohort 1,notexist | ||
C1,Course 1,CAT1,cohort,student,Cohort 1,group1 | ||
shortname,fullname,category_idnumber,enrolment_1,enrolment_1_role,enrolment_1_cohortidnumber,enrolment_1_groupname | ||
C1,Course 1,CAT1,cohort,student,CV1,notexist | ||
C1,Course 1,CAT1,cohort,student,CV1,group1 |
2 changes: 2 additions & 0 deletions
2
admin/tool/uploadcourse/tests/fixtures/enrolment_cohort_missing_fields.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
shortname,fullname,category_idnumber,enrolment_1 | ||
C1,Course 1,CAT1,cohort |
3 changes: 3 additions & 0 deletions
3
admin/tool/uploadcourse/tests/fixtures/enrolment_cohort_multiple.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
shortname,fullname,category_idnumber,enrolment_1,enrolment_1_role,enrolment_1_cohortidnumber | ||
C1,Course 1,CAT1,cohort,student,CV1 | ||
C1,Course 1,CAT1,cohort,teacher,CV4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.