ethz-let / moodle-qtype_drawing

1 stars 6 forks source link

Failing phpunit tests #11

Closed ehsan42 closed 2 years ago

ehsan42 commented 2 years ago

Hi,

Getting the following error when running the following phpunit tests. There are being ran using the moodle-docker https://github.com/moodlehq/moodle-docker. We have ran the same using php7.3.33 but still get the same errors

Moodle 3.9.11+ (Build: 20211207), 55a40f54c2b4d3b57368b41e84278e8f5f039b70 Php: 7.4.26, mysqli: 5.7.36, OS: Linux 5.4.0-91-generic x86_64 PHPUnit 7.5.20 by Sebastian Bergmann and contributors.

E 1 / 1 (100%)

Time: 1.06 minutes, Memory: 52.50 MB

There was 1 error:

1) qtype_drawing_walkthrough_testcase::test_deferred_feedback_plain_text Creating default object from empty value

/var/www/html/question/type/drawing/tests/helper.php:61 /var/www/html/question/type/drawing/tests/helper.php:81 /var/www/html/question/engine/tests/helpers.php:269 /var/www/html/question/engine/tests/helpers.php:285 /var/www/html/question/type/drawing/tests/walkthrough_test.php:39 /var/www/html/lib/phpunit/classes/advanced_testcase.php:80 /var/www/html/vendor/phpunit/phpunit/phpunit:60

To re-run: vendor/bin/phpunit "qtype_drawing_walkthrough_testcase" question/type/drawing/tests/walkthrough_test.php


Moodle 3.9.11+ (Build: 20211207), 55a40f54c2b4d3b57368b41e84278e8f5f039b70 Php: 7.4.26, mysqli: 5.7.36, OS: Linux 5.4.0-91-generic x86_64 PHPUnit 7.5.20 by Sebastian Bergmann and contributors.

.FE 3 / 3 (100%)

Time: 1.15 seconds, Memory: 52.50 MB

There was 1 error:

1) qtype_drawing_test::test_get_random_guess_score Creating default object from empty value

/var/www/html/question/type/drawing/tests/questiontype_test.php:54 /var/www/html/question/type/drawing/tests/questiontype_test.php:67 /var/www/html/lib/phpunit/classes/advanced_testcase.php:80 /var/www/html/vendor/phpunit/phpunit/phpunit:60

To re-run: vendor/bin/phpunit "qtype_drawing_test" question/type/drawing/tests/questiontype_test.php


Moodle 3.9.11+ (Build: 20211207), 55a40f54c2b4d3b57368b41e84278e8f5f039b70 Php: 7.4.26, mysqli: 5.7.36, OS: Linux 5.4.0-91-generic x86_64 PHP Fatal error: Uncaught Error: Class 'question_test_helper' not found in /var/www/html/question/type/drawing/tests/helper.php:32 Stack trace:

0 /var/www/html/vendor/phpunit/phpunit/src/Util/FileLoader.php(57): include_once()

1 /var/www/html/vendor/phpunit/phpunit/src/Util/FileLoader.php(45): PHPUnit\Util\FileLoader::load('/var/www/html/q...')

2 /var/www/html/lib/phpunit/classes/autoloader.php(69): PHPUnit\Util\FileLoader::checkAndLoad('/var/www/html/q...')

3 /var/www/html/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php(157): phpunit_autoloader->load('qtype_drawing_t...', '/var/www/html/q...')

4 /var/www/html/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php(104): PHPUnit\Runner\BaseTestRunner->loadSuiteClass('qtype_drawing_t...', '/var/www/html/q...')

5 /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php(183): PHPUnit\Runner\BaseTestRunner->getTest('qtype_drawing_t...', '/var/www/html/q...', Array)

6 /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php(162): PHPUnit\TextUI\Command->run(Array, t in /var/www/html/question/type/drawing/tests/helper.php on line 32

Fatal error: Uncaught Error: Class 'question_test_helper' not found in /var/www/html/question/type/drawing/tests/helper.php:32 Stack trace:

0 /var/www/html/vendor/phpunit/phpunit/src/Util/FileLoader.php(57): include_once()

1 /var/www/html/vendor/phpunit/phpunit/src/Util/FileLoader.php(45): PHPUnit\Util\FileLoader::load('/var/www/html/q...')

2 /var/www/html/lib/phpunit/classes/autoloader.php(69): PHPUnit\Util\FileLoader::checkAndLoad('/var/www/html/q...')

3 /var/www/html/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php(157): phpunit_autoloader->load('qtype_drawing_t...', '/var/www/html/q...')

4 /var/www/html/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php(104): PHPUnit\Runner\BaseTestRunner->loadSuiteClass('qtype_drawing_t...', '/var/www/html/q...')

5 /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php(183): PHPUnit\Runner\BaseTestRunner->getTest('qtype_drawing_t...', '/var/www/html/q...', Array)

6 /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php(162): PHPUnit\TextUI\Command->run(Array, t in /var/www/html/question/type/drawing/tests/helper.php on line 32

root@ehsananwar-HP-EliteBook-840-G3:/var/www/html/moodle-docker# bin/moodle-docker-compose exec webserver vendor/bin/phpunit qtype_drawing_test_helper question/type/drawing/tests/helper.php

To re-run: vendor/bin/phpunit qtype_drawing_test_helper question/type/drawing/tests/helper.php