Skip to content

Commit

Permalink
Tests: Call parent setup() function when instantiating PHPUnit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abias committed Oct 27, 2024
1 parent 383d513 commit d3373cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ moodle-availability_cohort
Changes
-------

### Unreleased

* 2024-10-27 - Tests: Call parent setup() function when instantiating PHPUnit tests.

### v4.3-r3

* 2024-08-23 - Bugfix: Fix 'Invalid database query parameter value' exception when restoring course with 'Any cohort' restriction, thanks to mi-dave.
Expand Down
6 changes: 5 additions & 1 deletion tests/condition_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ final class condition_test extends \advanced_testcase {
* Load required classes.
*/
public function setUp(): void {
// Load the mock info class so that it can be used.
global $CFG;

// Load the mock info class so that it can be used.
require_once($CFG->dirroot . '/availability/tests/fixtures/mock_info.php');

// Call parent setup.
parent::setUp();
}

/**
Expand Down

0 comments on commit d3373cd

Please sign in to comment.