From 520a5f92953d350880355dbe46217d2b41edd2bd Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 31 Aug 2011 17:49:48 -0400 Subject: [feature/extension-manager] Refactoring the structure of extension provider PHPBB3-10323 --- tests/cron/task_provider_test.php | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/cron/task_provider_test.php (limited to 'tests/cron/task_provider_test.php') diff --git a/tests/cron/task_provider_test.php b/tests/cron/task_provider_test.php new file mode 100644 index 0000000000..5565d0f64c --- /dev/null +++ b/tests/cron/task_provider_test.php @@ -0,0 +1,43 @@ +extension_manager = new phpbb_mock_extension_manager( + dirname(__FILE__) . '/', + array( + 'testext' => array( + 'ext_name' => 'testext', + 'ext_active' => true, + 'ext_path' => 'ext/testext/' + ), + )); + $this->provider = new phpbb_cron_task_provider($this->extension_manager); + } + + public function test_manager_finds_shipped_tasks() + { + $tasks = array(); + foreach ($this->provider as $task) + { + $tasks[] = $task; + } + sort($tasks); + + $this->assertEquals(array( + 'phpbb_cron_task_core_dummy_task', + 'phpbb_cron_task_core_second_dummy_task', + 'phpbb_ext_testext_cron_dummy_task', + ), $tasks); + } +} -- cgit v1.2.1