MDL-41220 fix test_get_plugin_list_with_file
authorPetr Škoda <commits@skodak.org>
Mon, 30 Sep 2013 20:55:51 +0000 (22:55 +0200)
committerPetr Škoda <commits@skodak.org>
Fri, 4 Oct 2013 14:01:04 +0000 (16:01 +0200)
lib/tests/component_test.php

index 0090081..d7fa6d2 100644 (file)
@@ -341,11 +341,17 @@ class core_component_testcase extends advanced_testcase {
     }
 
     public function test_get_plugin_list_with_file() {
-        // Force the cache reset.
-        phpunit_util::reset_all_data();
         $this->resetAfterTest(true);
 
-        $expected = array('completion', 'log', 'loglive', 'outline', 'participation', 'progress', 'stats');
+        // No extra reset here because core_component reset automatically.
+
+        $expected = array();
+        $reports = core_component::get_plugin_list('report');
+        foreach ($reports as $name => $fulldir) {
+            if (file_exists("$fulldir/lib.php")) {
+                $expected[] = $name;
+            }
+        }
 
         // Test cold.
         $list = core_component::get_plugin_list_with_file('report', 'lib.php', false);