open-lms-open-source / moodle-theme_snap

GNU General Public License v3.0
79 stars 75 forks source link

moodle 3.9 unit test failure test_lti_icons_are_displayed - deprecated function get_module_metadata #185

Open kristian-94 opened 3 years ago

kristian-94 commented 3 years ago

We get the following unit test failure because we are using a now deprecated function called get_module_metadata in /theme/snap/classes/output/core_renderer.php:

root@05fa61441cd5:/siteroot# vendor/bin/phpunit "theme_snap_lti_icons_displaying" theme/snap/tests/lti_icons_displaying_test.php Moodle 3.9.2+ (Build: 20200918), 1b65b4aa3f5c92d7631880cb61ce8a9ae9db16ac Php: 7.2.24.0.0.18.04.3, pgsql: 9.6.17, OS: Linux 4.15.0-117-generic x86_64 PHPUnit 7.5.20 by Sebastian Bergmann and contributors.

E 1 / 1 (100%)

Time: 2.19 seconds, Memory: 98.50 MB

There was 1 error:

1) theme_snap_lti_icons_displaying::test_lti_icons_are_displayed Unexpected debugging() call detected. Debugging: get_module_metadata is deprecated. Please use \core_course\local\service\content_item_service instead.

  • line 3325 of /lib/deprecatedlib.php: call to debugging()
  • line 1546 of /theme/snap/classes/output/core_renderer.php: call to get_module_metadata()
  • line 1593 of /theme/snap/classes/output/core_renderer.php: call to theme_snap\output\core_renderer->course_modchooser()
  • line 78 of /theme/snap/tests/lti_icons_displaying_test.php: call to theme_snap\output\core_renderer->testhelper_course_modchooser()
  • line 1154 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to theme_snap_lti_icons_displaying->test_lti_icons_are_displayed()
  • line 842 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
  • line 80 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
  • line 693 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
  • line 796 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
  • line 746 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
  • line 652 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
  • line 206 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->doRun()
  • line 162 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
  • line 61 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()

/siteroot/lib/phpunit/classes/advanced_testcase.php:88

To re-run: vendor/bin/phpunit "theme_snap_lti_icons_displaying" theme/snap/tests/lti_icons_displaying_test.php

ERRORS! Tests: 1, Assertions: 2, Errors: 1.