Skip to content

Commit

Permalink
MDL-59057 analytics: Unit test fixes
Browse files Browse the repository at this point in the history
Updating tests according to courses - site_courses analysers change.

Part of MDL-57791 epic.
  • Loading branch information
David Monllao committed Jul 24, 2017
1 parent 20b77f9 commit bd16408
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions analytics/classes/local/analyser/courses.php
Expand Up @@ -66,13 +66,12 @@ public function sample_access_context($sampleid) {
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))
);
}

Expand Down
2 changes: 1 addition & 1 deletion analytics/tests/fixtures/test_target_shortname.php
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion analytics/tests/model_test.php
Expand Up @@ -86,7 +86,7 @@ public function test_model_manager() {
$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() {
Expand Down

0 comments on commit bd16408

Please sign in to comment.