Open ScottVerbeek opened 10 months ago
Running the unit tests locally:
root@6134396f5f13:/var/www/site# vendor/bin/phpunit --testsuite logstore_xapi_testsuite --filter 'logstore_xapi\\mod_book' --testdox
Moodle 4.4dev (Build: 20231124), 6374475dc3cf3a94e22ec18c4655b89819a1b5d6
Php: 8.1.24, pgsql: 14.0 (Debian 14.0-1.pgdg110+1), OS: Linux 6.4.12-060412-generic x86_64
PHPUnit 9.5.28 by Sebastian Bergmann and contributors.
existing_chapter_viewed_with_parent_test (logstore_xapi\mod_book\chapter_viewed\existing_chapter_viewed_with_parent\existing_chapter_viewed_with_parent_test)
✔ Init
✔ Create event
existing_chapter_viewed_without_parent_test (logstore_xapi\mod_book\chapter_viewed\existing_chapter_viewed_without_parent\existing_chapter_viewed_without_parent_test)
✔ Init
✔ Create event
existing_module_test (logstore_xapi\mod_book\course_module_viewed\existing_module\existing_module_test)
✔ Init
✔ Create event
Time: 00:00.217, Memory: 76.50 MB
OK (6 tests, 6 assertions)
Description
\mod_book\event\chapter_viewed
event for modulemod_book
was fetching a parent chapter incorrectly. Before subchapter was used as a ID, which is actually a boolean value. Here is a representation of what it should look like, and should help understand the code.array $query
contained exactly one element.Related Issues
776
850
PR Type