turnitin / moodle-plagiarism_turnitin

Turnitin Plagiarism plugin for Moodle
http://www.turnitin.com
GNU General Public License v3.0
49 stars 71 forks source link

Failing unit tests in Moodle 4.3 #712

Closed saidisalem closed 3 months ago

saidisalem commented 5 months ago

plagiarism_turnitin is failing to pass unit testing with Moodle 4.3. 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 288 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()

/var/www/html/lib/phpunit/classes/advanced_testcase.php:89

ERRORS!
Tests: 28, Assertions: 89, Errors: 1.

There is a patch already implemented for 4.2, please see : https://github.com/turnitin/moodle-plagiarism_turnitin/issues/683