turnitin / moodle-plagiarism_turnitin

Turnitin Plagiarism plugin for Moodle
http://www.turnitin.com
45 stars 65 forks source link

Failing unit tests in Moodle 4.2 - MDL-74923 #683

Open golenkovm opened 6 months ago

golenkovm commented 6 months ago

plagiarism_turnitin is failing to pass unit testing with Moodle 4.2. There are some changes to quiz classes in Moodle core, please see the trace below:

plagiarism_turnitin_quiz_testcase::test_update_mark
Unexpected debugging() call detected.
Debugging: Class 'quiz' has been renamed for the autoloader and is now deprecated. Please use 'mod_quiz\quiz_settings' instead.
* line 153 of /lib/classes/component.php: call to debugging()
* line 58 of /plagiarism/turnitin/tests/modules/turnitin_quiz_test.php: call to core_component::classloader()
* line 1548 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to plagiarism_turnitin_quiz_testcase->test_update_mark()
* line 1154 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 81 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 728 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 904 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 653 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 144 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 97 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 98 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()
* line 122 of /vendor/bin/phpunit: call to include()

Debugging: Class 'quiz_attempt' has been renamed for the autoloader and is now deprecated. Please use 'mod_quiz\quiz_attempt' instead.
* line 153 of /lib/classes/component.php: call to debugging()
* line 72 of /plagiarism/turnitin/tests/modules/turnitin_quiz_test.php: call to core_component::classloader()
* line 1548 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to plagiarism_turnitin_quiz_testcase->test_update_mark()
* line 1154 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 81 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 728 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 904 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 653 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 144 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 97 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 98 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()
* line 122 of /vendor/bin/phpunit: call to include()

Debugging: quiz_save_best_grade is deprecated. Please use a standard grade_calculator::recompute_final_grade instead.
* line 391 of /mod/quiz/deprecatedlib.php: call to debugging()
* line 104 of /plagiarism/turnitin/classes/modules/turnitin_quiz.class.php: call to quiz_save_best_grade()
* line 86 of /plagiarism/turnitin/tests/modules/turnitin_quiz_test.php: call to turnitin_quiz->update_mark()
* line 1548 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to plagiarism_turnitin_quiz_testcase->test_update_mark()
* line 1154 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 81 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 728 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 904 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 653 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 144 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 97 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 98 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()
* line 122 of /vendor/bin/phpunit: call to include()
golenkovm commented 6 months ago

Implemented a patch for this, please see

Can't create a PR as a new stable branch needs to be created for Moodle 4.2 onwards.

Kind regards, Misha