Skip to content

Commit

Permalink
PM-47393 fixed test setup and failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-kialo committed Jan 9, 2025
1 parent b3feefe commit 646b57e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion development/tests-privacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion development/tests-run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion development/tests-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
5 changes: 3 additions & 2 deletions tests/lib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 646b57e

Please sign in to comment.