sbourget / moodle-mod_pcast

A podcasting module for Moodle.
12 stars 10 forks source link

Failed tool_dataprivacy\expired_contexts_test CI/CD unit testing #13

Open niko-hoogeveen opened 3 months ago

niko-hoogeveen commented 3 months ago

SQL queries coming back with errors in provider.php. Changing ge.userid to pe.userid and g.id to p.id fixes these errors.

There were 4 errors:

1) tool_dataprivacy\expired_contexts_test::test_process_course_context_with_override_unexpired_role Unexpected debugging() call detected. Debugging: Error reading from database (ERROR: missing FROM-clause entry for table "g" LINE 8: JOIN phpu_pcast p ON g.id = cm.instance ^

        SELECT DISTINCT u.id
        FROM phpu_user u
        JOIN (SELECT ge.userid
              FROM phpu_context c
              JOIN phpu_course_modules cm ON cm.id = c.instanceid AND c.contextlevel = $1
              JOIN phpu_modules m ON m.id = cm.module AND m.name = $2
              JOIN phpu_pcast p ON g.id = cm.instance
              JOIN phpu_pcast_episodes pe ON pe.pcastid = p.id
             WHERE c.id = $3) target ON u.id = target.userid

[array ( 0 => 70, 1 => 'pcast', 2 => 110001, )])

/var/www/stfx-main-campus/lib/phpunit/classes/advanced_testcase.php:88

2) tool_dataprivacy\expired_contexts_test::test_process_course_context_with_override_expired_role Unexpected debugging() call detected. Debugging: Error reading from database (ERROR: missing FROM-clause entry for table "g" LINE 8: JOIN phpu_pcast p ON g.id = cm.instance ^

        SELECT DISTINCT u.id
        FROM phpu_user u
        JOIN (SELECT ge.userid
              FROM phpu_context c
              JOIN phpu_course_modules cm ON cm.id = c.instanceid AND c.contextlevel = $1
              JOIN phpu_modules m ON m.id = cm.module AND m.name = $2
              JOIN phpu_pcast p ON g.id = cm.instance
              JOIN phpu_pcast_episodes pe ON pe.pcastid = p.id
             WHERE c.id = $3) target ON u.id = target.userid

[array ( 0 => 70, 1 => 'pcast', 2 => 110001, )])

/var/www/stfx-main-campus/lib/phpunit/classes/advanced_testcase.php:88

3) tool_dataprivacy\expired_contexts_test::test_process_course_context_with_user_in_both_lists Unexpected debugging() call detected. Debugging: Error reading from database (ERROR: missing FROM-clause entry for table "g" LINE 8: JOIN phpu_pcast p ON g.id = cm.instance ^

        SELECT DISTINCT u.id
        FROM phpu_user u
        JOIN (SELECT ge.userid
              FROM phpu_context c
              JOIN phpu_course_modules cm ON cm.id = c.instanceid AND c.contextlevel = $1
              JOIN phpu_modules m ON m.id = cm.module AND m.name = $2
              JOIN phpu_pcast p ON g.id = cm.instance
              JOIN phpu_pcast_episodes pe ON pe.pcastid = p.id
             WHERE c.id = $3) target ON u.id = target.userid

[array ( 0 => 70, 1 => 'pcast', 2 => 110001, )])

/var/www/stfx-main-campus/lib/phpunit/classes/advanced_testcase.php:88

4) tool_dataprivacy\expired_contexts_test::test_process_course_context_with_user_in_both_lists_expired Unexpected debugging() call detected. Debugging: Error reading from database (ERROR: missing FROM-clause entry for table "g" LINE 8: JOIN phpu_pcast p ON g.id = cm.instance ^

        SELECT DISTINCT u.id
        FROM phpu_user u
        JOIN (SELECT ge.userid
              FROM phpu_context c
              JOIN phpu_course_modules cm ON cm.id = c.instanceid AND c.contextlevel = $1
              JOIN phpu_modules m ON m.id = cm.module AND m.name = $2
              JOIN phpu_pcast p ON g.id = cm.instance
              JOIN phpu_pcast_episodes pe ON pe.pcastid = p.id
             WHERE c.id = $3) target ON u.id = target.userid

[array ( 0 => 70, 1 => 'pcast', 2 => 110001, )])

/var/www/stfx-main-campus/lib/phpunit/classes/advanced_testcase.php:88

sbourget commented 1 day ago

Any chance you can send me a pull request with your changes so I can test & merge them?