Skip to content

Commit

Permalink
fix wrong unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
TamaroWalter committed Sep 18, 2024
1 parent d51288a commit 41ab0d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
* of events have all the required attributes from the townsquaresupport interface.
*
* @param array $subevents
* @return int
* @return bool
*/
function townsquaresupport_check_subplugin_events($subevents): int {
function townsquaresupport_check_subplugin_events($subevents): bool {
if (!gettype($subevents == 'array')) {
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/eventcheck_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ private function helper_test_set_up(): void {
'timestart' => 123456787, 'coursemoduleid' => 16, 'eventtype' => 'eventtypeone', ];

// Build different combinations of the events.
$this->testdata->subevents1 = [$incorrecteevent1, $correctevent1];
$this->testdata->subevents2 = [$incorrecteevent2, $correctevent2];
$this->testdata->subevents3 = [$correctevent1, $correctevent2];
$this->testdata->subevents1 = [(object)$incorrecteevent1, (object)$correctevent1];
$this->testdata->subevents2 = [(object)$incorrecteevent2, (object)$correctevent2];
$this->testdata->subevents3 = [(object)$correctevent1, (object)$correctevent2];
$this->testdata->subevents4 = ['arraykey' => 'incorrectsubevent'];
}

Expand Down

0 comments on commit 41ab0d2

Please sign in to comment.