MDL-39723 prevent update_courses() bad habits.
commit36e5df06b36013b1a982de921b75a94f8d20bdf6
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 4 Jun 2013 19:45:15 +0000 (4 21:45 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 4 Jun 2013 19:49:35 +0000 (4 21:49 +0200)
treee0bd09046e9ca1165befe5cf253e726d9147f971
parent8c8b3eba2479e99a69a07ca77487d5954584dd49
MDL-39723 prevent update_courses() bad habits.

All the external functions end calling require_login() that is
always in charge of setting the $COURSE global. This is not a
problem, but in the case of core_course_external::update_courses()
testing, where we are, in the same "request", both setting and getting
the $COURSE information and it's clearly outdated, so the test fails.

Alternative solution would be to modify the external function to ensure
that, after updating a course, $COURSE is also updated with the changes
but it does not seem to be necessary for "normal" usage (both UI/WS POVs).
course/tests/externallib_test.php