mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-59057 analytics: Unit test fixes
Updating tests according to courses - site_courses analysers change. Part of MDL-57791 epic.
This commit is contained in:
parent
20b77f9b63
commit
bd164083eb
@ -66,13 +66,12 @@ class courses extends by_course {
|
||||
protected function get_all_samples(\core_analytics\analysable $course) {
|
||||
global $DB;
|
||||
|
||||
$coursedata = $course->get_course_data();
|
||||
$context = \context_course::instance($course->get_id());
|
||||
|
||||
// Just 1 sample per analysable.
|
||||
return array(
|
||||
array($course->get_id() => $course->get_id()),
|
||||
array($course->get_id() => array('course' => $course, 'context' => $context))
|
||||
array($course->get_id() => array('course' => $course->get_course_data(), 'context' => $context))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@ class test_target_shortname extends \core_analytics\local\target\binary {
|
||||
protected $predictions = array();
|
||||
|
||||
public function get_analyser_class() {
|
||||
return '\core_analytics\local\analyser\courses';
|
||||
return '\core_analytics\local\analyser\site_courses';
|
||||
}
|
||||
|
||||
public static function classes_description() {
|
||||
|
@ -86,7 +86,7 @@ class analytics_model_testcase extends advanced_testcase {
|
||||
$this->assertInstanceOf('\core_analytics\local\analyser\base', $this->model->get_analyser());
|
||||
|
||||
$this->model->enable('\core_analytics\local\time_splitting\quarters');
|
||||
$this->assertInstanceOf('\core_analytics\local\analyser\courses', $this->model->get_analyser());
|
||||
$this->assertInstanceOf('\core_analytics\local\analyser\site_courses', $this->model->get_analyser());
|
||||
}
|
||||
|
||||
public function test_output_dir() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user