diff --git a/development/tests-privacy.sh b/development/tests-privacy.sh index 6e6ef34..e3af0f1 100755 --- a/development/tests-privacy.sh +++ b/development/tests-privacy.sh @@ -2,4 +2,4 @@ ./sync.sh # Run the tests -docker exec -i mod_kialo-moodle-1 /bin/bash -c "cd /var/www/html; vendor/bin/phpunit --testsuite core_privacy_testsuite --filter kialo" +docker exec -i mod_kialo-moodle-1 /bin/bash -c "cd /var/www/html; mod/kialo/vendor/bin/phpunit --testsuite core_privacy_testsuite --filter kialo" diff --git a/development/tests-run-all.sh b/development/tests-run-all.sh index 62ad3a3..4d63b15 100755 --- a/development/tests-run-all.sh +++ b/development/tests-run-all.sh @@ -2,4 +2,4 @@ ./sync.sh # Run the tests -docker exec -i mod_kialo-moodle-1 /bin/bash -c "cd /var/www/html; vendor/bin/phpunit --testsuite mod_kialo_testsuite" +docker exec -i mod_kialo-moodle-1 /bin/bash -c "cd /var/www/html; mod/kialo/vendor/bin/phpunit --testsuite mod_kialo_testsuite" diff --git a/development/tests-run.sh b/development/tests-run.sh index 78c3831..a414e5d 100755 --- a/development/tests-run.sh +++ b/development/tests-run.sh @@ -3,4 +3,4 @@ # Run a specific test file (path relative to mod/kialo/tests) # Example: ./tests-run.sh classes/mod_kialo_test.php -docker exec -i mod_kialo-moodle-1 /bin/bash -c "cd /var/www/html; vendor/bin/phpunit mod/kialo/tests/$1" +docker exec -i mod_kialo-moodle-1 /bin/bash -c "cd /var/www/html; mod/kialo/vendor/bin/phpunit mod/kialo/tests/$1" diff --git a/tests/lib_test.php b/tests/lib_test.php index e8ec8fc..30f2e85 100644 --- a/tests/lib_test.php +++ b/tests/lib_test.php @@ -138,11 +138,12 @@ public function test_kialo_get_coursemodule_info_new_window(): void { 'course' => $course, 'display' => MOD_KIALO_DISPLAY_IN_NEW_WINDOW, ]); - $info = kialo_get_coursemodule_info($activity); + $cm = get_coursemodule_from_instance("kialo", $activity->id); + $info = kialo_get_coursemodule_info($cm); // Clicking the activity name should open a new window by default. $this->assertStringContainsString("window.open", $info->onclick); - $this->assertStringContainsString("/mod/kialo/view.php?id=" . $activity->id, $info->onclick); + $this->assertStringContainsString("/mod/kialo/view.php?id=" . $cm->id, $info->onclick); } /**