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:
David Monllao 2017-06-12 08:46:14 +02:00
parent 20b77f9b63
commit bd164083eb
3 changed files with 3 additions and 4 deletions

View File

@ -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))
);
}

View File

@ -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() {

View File

@ -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() {