Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Failing unit test repeated_restore_test.php #247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
niko-hoogeveen opened this issue Mar 20, 2025 · 0 comments
Open

Failing unit test repeated_restore_test.php #247

niko-hoogeveen opened this issue Mar 20, 2025 · 0 comments

Comments

@niko-hoogeveen
Copy link

Hi there,

I've noticed a few issues with qtype_coderunner when running PHP unit tests with the plugin installed. The specific unit test failing is mod/quiz/tests/backup/repeated_restore_test.php. Note this issue is related to https://tracker.moodle.org/browse/MDL-83541 and some further information about how to fix it can be found here: https://moodledev.io/docs/5.0/apis/plugintypes/qtype/restore.

Environment:

PHP 8.1
Moodle 4.5
MySQL 8.0
Branch: master

Error messages:

1) mod_quiz\backup\repeated_restore_test::test_restore_quiz_with_duplicate_questions with data set "coderunner" ('coderunner', 'sqr')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'150002'
+'150003'

/var/www/site/mod/quiz/tests/backup/repeated_restore_test.php:423
/var/www/site/lib/phpunit/classes/advanced_testcase.php:76

2) mod_quiz\backup\repeated_restore_test::test_restore_quiz_with_edited_questions with data set "coderunner" ('coderunner', 'sqr')
Failed asserting that 150000 matches expected '150002'.

/var/www/site/mod/quiz/tests/backup/repeated_restore_test.php:490
/var/www/site/lib/phpunit/classes/advanced_testcase.php:76
trampgeek added a commit that referenced this issue Apr 3, 2025
…the fix for MDL-83541. This commit adds the functionality required to pass the repeated_restore test, but CodeRunner questions are still being duplicated when a quiz is duplicated or a course restored. Needs a deeper dive, but time is limited.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant