From 9ebd40eddfdb83e9b3feafd45689fb3d5f160db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Mon, 30 Sep 2013 22:55:51 +0200 Subject: [PATCH] MDL-41220 fix test_get_plugin_list_with_file --- lib/tests/component_test.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/tests/component_test.php b/lib/tests/component_test.php index 0090081cc28..d7fa6d2a044 100644 --- a/lib/tests/component_test.php +++ b/lib/tests/component_test.php @@ -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);