Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #64: fix broken external classes #65

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions classes/external/condition_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
use tool_dynamic_cohorts\condition_base;
use tool_dynamic_cohorts\condition_form as form;

defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/lib/externallib.php');

/**
* Condition form AJAX submission.
*
Expand Down
4 changes: 4 additions & 0 deletions classes/external/matching_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
use invalid_parameter_exception;
use tool_dynamic_cohorts\rule_manager;

defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/lib/externallib.php');

/**
* Matching users external APIs.
*
Expand Down
4 changes: 4 additions & 0 deletions classes/external/rule_conditions.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
use tool_dynamic_cohorts\rule;
use invalid_parameter_exception;

defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/lib/externallib.php');

/**
* Rule conditions external APIs.
*
Expand Down
10 changes: 0 additions & 10 deletions tests/external/matching_users_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@
*/
class matching_users_test extends externallib_advanced_testcase {

/**
* Set up.
*/
public function setUp(): void {
global $CFG;

require_once($CFG->dirroot . '/lib/externallib.php');
parent::setUp();
}

/**
* Test exception if rule is not exist.
*/
Expand Down
10 changes: 0 additions & 10 deletions tests/external/rule_conditions_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@
*/
class rule_conditions_test extends externallib_advanced_testcase {

/**
* Set up.
*/
public function setUp(): void {
global $CFG;

require_once($CFG->dirroot . '/lib/externallib.php');
parent::setUp();
}

/**
* Test exception if rule is not exist.
*/
Expand Down
Loading