Skip to content

Commit

Permalink
Merge branch 'MDL-73476' of https://github.com/stronk7/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Jan 18, 2022
2 parents cb3e2ee + 0c53a3d commit 6670c04
Show file tree
Hide file tree
Showing 74 changed files with 1,999 additions and 1,848 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@
* @since Moodle 3.8
*/

namespace tool_analytics\external;

use externallib_advanced_testcase;

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

global $CFG;

require_once($CFG->dirroot . '/webservice/tests/helpers.php');
require_once(__DIR__ . '/../../../../analytics/tests/fixtures/test_indicator_max.php');
require_once(__DIR__ . '/../../../../analytics/tests/fixtures/test_target_course_level_shortname.php');
require_once($CFG->dirroot . '/analytics/tests/fixtures/test_indicator_max.php');
require_once($CFG->dirroot . '/analytics/tests/fixtures/test_target_course_level_shortname.php');

/**
* Tool analytics external functions tests
Expand All @@ -41,7 +45,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since Moodle 3.8
*/
class tool_analytics_external_testcase extends externallib_advanced_testcase {
class external_test extends externallib_advanced_testcase {

/**
* test_potential_contexts description
Expand Down Expand Up @@ -73,7 +77,7 @@ public function test_potential_contexts_no_manager() {
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);

$this->expectException(required_capability_exception::class);
$this->expectException(\required_capability_exception::class);
$this->assertCount(2, \tool_analytics\external::potential_contexts());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
*/

defined('MOODLE_INTERNAL') || die();
namespace tool_capability\event;

/**
* Class for capability overview events.
Expand All @@ -31,7 +31,7 @@
* @copyright 2014 Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
*/
class tool_capability_events_testcase extends advanced_testcase {
class events_test extends \advanced_testcase {

/**
* Setup testcase.
Expand All @@ -54,11 +54,11 @@ public function test_report_viewed() {
$event = reset($events);

$this->assertInstanceOf('\tool_capability\event\report_viewed', $event);
$this->assertEquals(context_system::instance(), $event->get_context());
$this->assertEquals(\context_system::instance(), $event->get_context());
$expected = array(SITEID, "admin", "tool capability", "tool/capability/index.php");
$this->assertEventLegacyLogData($expected, $event);
$this->assertEventContextNotUsed($event);
$url = new moodle_url('/admin/tool/capability/index.php');
$url = new \moodle_url('/admin/tool/capability/index.php');
$this->assertEquals($url, $event->get_url());
$event->get_name();
}
Expand Down
Loading

0 comments on commit 6670c04

Please sign in to comment.