MDL-57791 tests: Restore logstores pre-test state
authorDavid Monllao <davidm@moodle.com>
Mon, 24 Jul 2017 08:43:04 +0000 (10:43 +0200)
committerDavid Monllao <davidm@moodle.com>
Mon, 24 Jul 2017 08:43:04 +0000 (10:43 +0200)
analytics/tests/ma_test.php [moved from analytics/tests/prediction_test.php with 98% similarity]
lib/tests/indicators_test.php

similarity index 98%
rename from analytics/tests/prediction_test.php
rename to analytics/tests/ma_test.php
index f335a15..a0d278b 100644 (file)
@@ -193,6 +193,9 @@ class core_analytics_prediction_testcase extends advanced_testcase {
             array('modelid' => $model->get_id(), 'action' => 'predicted')));
         $this->assertEquals(2 * $npredictedranges, $DB->count_records('analytics_predictions',
             array('modelid' => $model->get_id())));
+
+        set_config('enabled_stores', '', 'tool_log');
+        get_log_manager(true);
     }
 
     /**
@@ -271,6 +274,9 @@ class core_analytics_prediction_testcase extends advanced_testcase {
             $filtered = $result->status & $expected[$timesplitting];
             $this->assertEquals($expected[$timesplitting], $filtered, $message);
         }
+
+        set_config('enabled_stores', '', 'tool_log');
+        get_log_manager(true);
     }
 
     /**
index 13461d0..59058ed 100644 (file)
@@ -232,5 +232,8 @@ class core_analytics_indicators_testcase extends advanced_testcase {
         $values = $indicator->calculate($sampleids, 'user', $startdate, $enddate);
         $this->assertEquals($indicator::get_max_value(), $values[$user1->id][0]);
         $this->assertEquals($indicator::get_min_value(), $values[$user2->id][0]);
+
+        set_config('enabled_stores', '', 'tool_log');
+        get_log_manager(true);
     }
 }