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

Remove the externallib dependency #105

Open
wants to merge 1 commit into
base: MOODLE_33PLUS
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

use auth_userkey\core_userkey_manager;
use auth_userkey\userkey_manager_interface;
use core_external\external_value;

require_once($CFG->libdir . "/externallib.php");
require_once($CFG->libdir.'/authlib.php');
require_once($CFG->dirroot . '/user/lib.php');

Expand Down
6 changes: 5 additions & 1 deletion externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@

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

require_once($CFG->libdir . "/externallib.php");
use core_external\external_value;
use core_external\external_api;
use core_external\external_function_parameters;
use core_external\external_single_structure;

require_once($CFG->dirroot . "/webservice/lib.php");
require_once($CFG->dirroot . "/auth/userkey/auth.php");

Expand Down
3 changes: 1 addition & 2 deletions tests/auth_plugin_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use stdClass;
use invalid_parameter_exception;
use moodle_exception;
use external_value;
use core_external\external_value;

/**
* Tests for auth_plugin_userkey class.
Expand Down Expand Up @@ -57,7 +57,6 @@ class auth_plugin_test extends advanced_testcase {
public function setUp(): void {
global $CFG;

require_once($CFG->libdir . "/externallib.php");
require_once($CFG->dirroot . '/auth/userkey/tests/fake_userkey_manager.php');
require_once($CFG->dirroot . '/auth/userkey/auth.php');
require_once($CFG->dirroot . '/user/lib.php');
Expand Down
7 changes: 3 additions & 4 deletions tests/externallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use advanced_testcase;
use webservice_access_exception;
use auth_userkey_external;
use external_api;
use core_external\external_api;
use invalid_parameter_exception;
use required_capability_exception;
use context_system;
Expand All @@ -37,17 +37,16 @@ class externallib_test extends advanced_testcase {
/**
* User object.
*
* @var
* @var stdClass
*/
protected $user = array();
protected $user;

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

require_once($CFG->libdir . "/externallib.php");
require_once($CFG->dirroot . '/auth/userkey/externallib.php');

$this->resetAfterTest();
Expand Down
Loading