MDL-70959 completion: Fix completion_info::get_data() unit tests
commit6bc25f23fd568fe3c29d4b87e2119028d0d3a910
authorJun Pataleta <jun@moodle.com>
Mon, 15 Mar 2021 06:39:08 +0000 (15 14:39 +0800)
committerJun Pataleta <jun@moodle.com>
Fri, 19 Mar 2021 03:52:23 +0000 (19 11:52 +0800)
treee0f5e8be7af3e75dcea5ca1b8daabd748935eba7
parent42631c3e34258d9b9c6ab803921f4d9c03ecd35c
MDL-70959 completion: Fix completion_info::get_data() unit tests

* Fixed inverted $sameuser test data.
* Fixed caching expectation check. Caching only relies on whether the
user accessing the completion data is the same user or not.
* Fixed checking for the caching of other modules. Should have been
checking cm ID and not instance ID.
* Additional test case when whole course parameter is passed as
true, but the requesting user is different from the target user.
lib/tests/completionlib_test.php