cursiveinc / moodle-tinymce_cursive

The Cursive plugin for Moodle extends TinyMCE to create a new layer of data (key event logs) which can be used in many ways (feedback, scoring, authentication) and can be connected to Cursive's ML server.
Other
2 stars 4 forks source link

PHPunit tests failures for Moodle 4.5 #62

Open sumaiyamannan opened 1 week ago

sumaiyamannan commented 1 week ago

Hi, The plugin is getting installed on the latest Moodle version but there are a lot of PHPunittest failures. See the list below

There was 1 error:
1) format_tiles\format_tiles_courselib_test::test_course_roles_reset
core\exception\moodle_exception: Unsupported redirect detected, script execution terminated
/moodle/lib/weblib.php:2089
/moodle/lib/moodlelib.php:2327
/moodle/lib/editor/tiny/plugins/cursive/classes/observers.php:31
/moodle/lib/classes/component.php:217
/moodle/lib/classes/event/manager.php:153
/moodle/lib/classes/event/manager.php:75
/moodle/lib/classes/event/base.php:795
/moodle/lib/moodlelib.php:5339
/moodle/course/format/tiles/tests/format_tiles_courselib_test.php:1432
/moodle/lib/phpunit/classes/advanced_testcase.php:76

1) tool_uploadcourse\course_test::test_reset
Unexpected debugging() call detected.
Debugging: Exception encountered in event observer '\tiny_cursive\observers::reset_tracking_data': Error reading from database (ERROR:  value "174000" is out of range for type smallint
CONTEXT:  unnamed portal parameter $1 = '...'
SELECT id, filename FROM phpu_tiny_cursive_files WHERE courseid = $1 
[array (
  0 => '174000',
)])
* line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
* line 358 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end()
* line 1044 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
* line 1516 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()
* line 1467 of /lib/dml/moodle_database.php: call to moodle_database->get_records_select()
* line 203 of /lib/editor/tiny/plugins/cursive/classes/observers.php: call to moodle_database->get_records()
* line ? of unknownfile: call to tiny_cursive\observers::reset_tracking_data()
* line 155 of /lib/classes/event/manager.php: call to call_user_func()
* line 75 of /lib/classes/event/manager.php: call to core\event\manager::process_buffers()
* line 795 of /lib/classes/event/base.php: call to core\event\manager::dispatch()
* line 5339 of /lib/moodlelib.php: call to core\event\base->trigger()
* line 1238 of /admin/tool/uploadcourse/classes/course.php: call to reset_course_userdata()
* line 932 of /admin/tool/uploadcourse/classes/course.php: call to tool_uploadcourse_course->reset()
* line 1150 of /admin/tool/uploadcourse/tests/course_test.php: call to tool_uploadcourse_course->proceed()
* line 1617 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to tool_uploadcourse\course_test->test_reset()
* line 1223 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 76 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 729 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 973 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 685 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 685 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 685 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 651 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 146 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 99 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 107 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()
* line 122 of /vendor/bin/phpunit: call to include()
Debugging: Exception encountered in event observer '\tiny_cursive\observers::reset_tracking_data': Error reading from database (ERROR:  value "174000" is out of range for type smallint
CONTEXT:  unnamed portal parameter $1 = '...'
SELECT id, filename FROM phpu_tiny_cursive_files WHERE courseid = $1 
[array (
  0 => '174000',
)])
* line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
* line 358 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end()
* line 1044 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
* line 1516 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()
* line 1467 of /lib/dml/moodle_database.php: call to moodle_database->get_records_select()
* line 203 of /lib/editor/tiny/plugins/cursive/classes/observers.php: call to moodle_database->get_records()
* line ? of unknownfile: call to tiny_cursive\observers::reset_tracking_data()
* line 155 of /lib/classes/event/manager.php: call to call_user_func()
* line 75 of /lib/classes/event/manager.php: call to core\event\manager::process_buffers()
* line 795 of /lib/classes/event/base.php: call to core\event\manager::dispatch()
* line 5339 of /lib/moodlelib.php: call to core\event\base->trigger()
* line 1238 of /admin/tool/uploadcourse/classes/course.php: call to reset_course_userdata()
* line 932 of /admin/tool/uploadcourse/classes/course.php: call to tool_uploadcourse_course->reset()
* line 1166 of /admin/tool/uploadcourse/tests/course_test.php: call to tool_uploadcourse_course->proceed()
* line 1617 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to tool_uploadcourse\course_test->test_reset()
* line 1223 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 76 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 729 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 973 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 685 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 685 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 685 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 651 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 146 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 99 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 107 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()
* line 122 of /vendor/bin/phpunit: call to include()
/moodle/lib/phpunit/classes/advanced_testcase.php:101

1) core_competency\hooks_test::test_hook_course_reset_competency_ratings
core\exception\moodle_exception: Unsupported redirect detected, script execution terminated
/moodle/lib/weblib.php:2089
/moodle/lib/moodlelib.php:2327
/moodle/lib/editor/tiny/plugins/cursive/classes/observers.php:31
/moodle/lib/classes/component.php:217
/moodle/lib/classes/event/manager.php:153
/moodle/lib/classes/event/manager.php:75
/moodle/lib/classes/event/base.php:795
/moodle/lib/moodlelib.php:5339
/moodle/competency/tests/hooks_test.php:158
/moodle/lib/phpunit/classes/advanced_testcase.php:76
2) core_competency\hooks_test::test_hook_user_deleted
Unexpected debugging() call detected.
Debugging: Exception encountered in event observer '\tiny_cursive\observers::reset_tracking_data': Error reading from database (ERROR:  value "174000" is out of range for type smallint
CONTEXT:  unnamed portal parameter $1 = '...'
SELECT id, filename FROM phpu_tiny_cursive_files WHERE courseid = $1 
[array (
  0 => '174000',
)])
* line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
* line 358 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end()
* line 1044 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
* line 1516 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()
* line 1467 of /lib/dml/moodle_database.php: call to moodle_database->get_records_select()
* line 203 of /lib/editor/tiny/plugins/cursive/classes/observers.php: call to moodle_database->get_records()
* line ? of unknownfile: call to tiny_cursive\observers::reset_tracking_data()
* line 155 of /lib/classes/event/manager.php: call to call_user_func()
* line 75 of /lib/classes/event/manager.php: call to core\event\manager::process_buffers()
* line 795 of /lib/classes/event/base.php: call to core\event\manager::dispatch()
* line 5339 of /lib/moodlelib.php: call to core\event\base->trigger()
* line 234 of /competency/tests/hooks_test.php: call to reset_course_userdata()
* line 1617 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to core_competency\hooks_test->test_hook_user_deleted()
* line 1223 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 76 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 729 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 973 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 685 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 685 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 685 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestSuite->run()
* line 651 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 146 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 99 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 107 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()
* line 122 of /vendor/bin/phpunit: call to include()
/moodle/lib/phpunit/classes/advanced_testcase.php:101

1) theme_boost\boostnavbar_test::test_remove_no_link_items with data set "All nodes have links links including leaf node. Set to remove section nodes." (array(array(true, false), array(true, false), array(true, false)), true, array(true, true, true, true, true, true))
Attempt to read property "id" on bool
/moodle/lib/editor/tiny/plugins/cursive/locallib.php:304
/moodle/lib/editor/tiny/plugins/cursive/lib.php:92
/moodle/lib/navigationlib.php:4954
/moodle/lib/navigationlib.php:4530
/moodle/lib/pagelib.php:844
/moodle/lib/pagelib.php:966
/moodle/lib/navigationlib.php:3903
/moodle/theme/boost/tests/boostnavbar_test.php:212
/moodle/lib/phpunit/classes/advanced_testcase.php:76
2) theme_boost\boostnavbar_test::test_remove_no_link_items with data set "Only some parent nodes have links. Leaf node has a link. Set to remove section nodes." (array(array(false, false), array(true, false), array(true, false)), true, array(true, true, true, true, true))
Attempt to read property "id" on bool
/moodle/lib/editor/tiny/plugins/cursive/locallib.php:304
/moodle/lib/editor/tiny/plugins/cursive/lib.php:92
/moodle/lib/navigationlib.php:4954
/moodle/lib/navigationlib.php:4530
/moodle/lib/pagelib.php:844
/moodle/lib/pagelib.php:966
/moodle/lib/navigationlib.php:3903
/moodle/theme/boost/tests/boostnavbar_test.php:212
/moodle/lib/phpunit/classes/advanced_testcase.php:76
3) theme_boost\boostnavbar_test::test_remove_no_link_items with data set "All parent nodes do not have links. Leaf node has a link. Set to remove section nodes." (array(array(false, false), array(false, false), array(true, false)), true, array(true, true, true, true))
Attempt to read property "id" on bool
/moodle/lib/editor/tiny/plugins/cursive/locallib.php:304
/moodle/lib/editor/tiny/plugins/cursive/lib.php:92
/moodle/lib/navigationlib.php:4954
/moodle/lib/navigationlib.php:4530
/moodle/lib/pagelib.php:844
/moodle/lib/pagelib.php:966
/moodle/lib/navigationlib.php:3903
/moodle/theme/boost/tests/boostnavbar_test.php:212
/moodle/lib/phpunit/classes/advanced_testcase.php:76
4) theme_boost\boostnavbar_test::test_remove_no_link_items with data set "All parent nodes have links. Leaf node does not has a link. Set to remove section nodes." (array(array(true, false), array(true, false), array(false, false)), true, array(true, true, true, true, true, false))
Attempt to read property "id" on bool
/moodle/lib/editor/tiny/plugins/cursive/locallib.php:304
/moodle/lib/editor/tiny/plugins/cursive/lib.php:92
/moodle/lib/navigationlib.php:4954
/moodle/lib/navigationlib.php:4530
/moodle/lib/pagelib.php:844
/moodle/lib/pagelib.php:966
/moodle/lib/navigationlib.php:3903
/moodle/theme/boost/tests/boostnavbar_test.php:212
/moodle/lib/phpunit/classes/advanced_testcase.php:76
5) theme_boost\boostnavbar_test::test_remove_no_link_items with data set "All parent nodes do not have links. Leaf node does not has a link. Set to remove section nodes." (array(array(false, false), array(false, false), array(false, false)), true, array(true, true, true, false))
Attempt to read property "id" on bool
/moodle/lib/editor/tiny/plugins/cursive/locallib.php:304
/moodle/lib/editor/tiny/plugins/cursive/lib.php:92
/moodle/lib/navigationlib.php:4954
/moodle/lib/navigationlib.php:4530
/moodle/lib/pagelib.php:844
/moodle/lib/pagelib.php:966
/moodle/lib/navigationlib.php:3903
/moodle/theme/boost/tests/boostnavbar_test.php:212
/moodle/lib/phpunit/classes/advanced_testcase.php:76
6) theme_boost\boostnavbar_test::test_remove_no_link_items with data set "Some parent nodes do not have links. Leaf node does not has a link. Set to remove section nodes." (array(array(true, false), array(false, false), array(false, false)), true, array(true, true, true, true, false))
Attempt to read property "id" on bool
/moodle/lib/editor/tiny/plugins/cursive/locallib.php:304
/moodle/lib/editor/tiny/plugins/cursive/lib.php:92
/moodle/lib/navigationlib.php:4954
/moodle/lib/navigationlib.php:4530
/moodle/lib/pagelib.php:844
/moodle/lib/pagelib.php:966
/moodle/lib/navigationlib.php:3903
/moodle/theme/boost/tests/boostnavbar_test.php:212
/moodle/lib/phpunit/classes/advanced_testcase.php:76
7) theme_boost\boostnavbar_test::test_remove_no_link_items with data set "All nodes have links links including leaf node and section nodes. Set to remove section nodes." (array(array(true, false), array(true, false), array(true, true), array(true, false)), true, array(true, true, true, true, true, true))
Attempt to read property "id" on bool
/moodle/lib/editor/tiny/plugins/cursive/locallib.php:304
/moodle/lib/editor/tiny/plugins/cursive/lib.php:92
/moodle/lib/navigationlib.php:4954
/moodle/lib/navigationlib.php:4530
/moodle/lib/pagelib.php:844
/moodle/lib/pagelib.php:966
/moodle/lib/navigationlib.php:3903
/moodle/theme/boost/tests/boostnavbar_test.php:212
/moodle/lib/phpunit/classes/advanced_testcase.php:76
8) theme_boost\boostnavbar_test::test_remove_no_link_items with data set "All nodes have links links including leaf node and section nodes. Set to not remove section nodes." (array(array(true, false), array(true, false), array(true, true), array(true, false)), false, array(true, true, true, true, true, true, true))
Attempt to read property "id" on bool
/moodle/lib/editor/tiny/plugins/cursive/locallib.php:304
/moodle/lib/editor/tiny/plugins/cursive/lib.php:92
/moodle/lib/navigationlib.php:4954
/moodle/lib/navigationlib.php:4530
/moodle/lib/pagelib.php:844
/moodle/lib/pagelib.php:966
/moodle/lib/navigationlib.php:3903
/moodle/theme/boost/tests/boostnavbar_test.php:212
/moodle/lib/phpunit/classes/advanced_testcase.php:76
9) theme_boost\boostnavbar_test::test_remove_no_link_items with data set "Only some parent nodes have links. Section node does not have a link. Set to not remove section nodes." (array(array(false, false), array(true, false), array(false, true), array(true, false)), true, array(true, true, true, true, true))
Attempt to read property "id" on bool
/moodle/lib/editor/tiny/plugins/cursive/locallib.php:304
/moodle/lib/editor/tiny/plugins/cursive/lib.php:92
/moodle/lib/navigationlib.php:4954
/moodle/lib/navigationlib.php:4530
/moodle/lib/pagelib.php:844
/moodle/lib/pagelib.php:966
/moodle/lib/navigationlib.php:3903
/moodle/theme/boost/tests/boostnavbar_test.php:212
/moodle/lib/phpunit/classes/advanced_testcase.php:76
nawazsharif commented 20 hours ago

@sumaiyamannan The issue has been resolved. Please check now: https://github.com/cursiveinc/moodle-tinymce_cursive/tree/MOODLE_404_STABLE

sumaiyamannan commented 2 hours ago

@nawazsharif I still see the errors. I have the 4.5 site on PHP 8.1 Can you please run the tests at your end and check?