From a61ab1e5e4bbe786d3f500438bb0dd6ca395989e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 8 Jun 2013 17:02:31 +0200 Subject: [ticket/11550] Use new functionality from the test case helpers Instead of duplicating the extension copy code, it is now in the helpers. So we remove the code from existing tests. PHPBB3-11550 --- tests/functional/extension_acp_test.php | 54 +++++++++------------------------ 1 file changed, 15 insertions(+), 39 deletions(-) (limited to 'tests/functional/extension_acp_test.php') diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 9badab8ced..ada17397d7 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -12,34 +12,33 @@ */ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case { - static private $copied_files = array(); static private $helper; + static protected $fixtures = array( + '', + ); + /** * This should only be called once before the tests are run. - * This is used to copy the extensions to the phpBB install + * This is used to copy the fixtures to the phpBB install */ static public function setUpBeforeClass() { - global $phpbb_root_path; - parent::setUpBeforeClass(); self::$helper = new phpbb_test_case_helpers(self); + self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures); + } - self::$copied_files = array(); - - if (file_exists($phpbb_root_path . 'ext/')) - { - // First, move any extensions setup on the board to a temp directory - self::$copied_files = self::$helper->copy_dir($phpbb_root_path . 'ext/', $phpbb_root_path . 'store/temp_ext/'); - - // Then empty the ext/ directory on the board (for accurate test cases) - self::$helper->empty_dir($phpbb_root_path . 'ext/'); - } + /** + * This should only be called once after the tests are run. + * This is used to remove the fixtures from the phpBB install + */ + static public function tearDownAfterClass() + { + parent::tearDownAfterClass(); - // Copy our ext/ files from the test case to the board - self::$copied_files = array_merge(self::$copied_files, self::$helper->copy_dir(dirname(__FILE__) . '/../extension/ext/', $phpbb_root_path . 'ext/')); + self::$helper->restore_original_ext_dir(); } public function setUp() @@ -84,29 +83,6 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->add_lang('acp/extensions'); } - /** - * This should only be called once after the tests are run. - * This is used to remove the files copied to the phpBB install - */ - static public function tearDownAfterClass() - { - global $phpbb_root_path; - - if (file_exists($phpbb_root_path . 'store/temp_ext/')) - { - // Copy back the board installed extensions from the temp directory - self::$helper->copy_dir($phpbb_root_path . 'store/temp_ext/', $phpbb_root_path . 'ext/'); - } - - // Remove all of the files we copied around (from board ext -> temp_ext, from test ext -> board ext) - self::$helper->remove_files(self::$copied_files); - - if (file_exists($phpbb_root_path . 'store/temp_ext/')) - { - self::$helper->empty_dir($phpbb_root_path . 'store/temp_ext/'); - } - } - public function test_list() { $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid); -- cgit v1.2.1 From 0b3f18208354aabc5b9c8901c2950e9626c3e5f3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 9 Jun 2013 17:40:33 +0200 Subject: [ticket/11550] We use a different fixture set for extension_acp_test.php PHPBB3-11550 --- tests/functional/extension_acp_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/functional/extension_acp_test.php') diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index ada17397d7..5f8e3762a6 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -27,7 +27,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case parent::setUpBeforeClass(); self::$helper = new phpbb_test_case_helpers(self); - self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures); + self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/../extension/ext/', self::$fixtures); } /** -- cgit v1.2.1 From 68d15f0f14dfdc827e1169a73c194a9e30795605 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 11 Jun 2013 11:14:24 +0200 Subject: [ticket/11550] Move comments to correct function PHPBB3-11550 --- tests/functional/extension_acp_test.php | 8 -------- 1 file changed, 8 deletions(-) (limited to 'tests/functional/extension_acp_test.php') diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 5f8e3762a6..b36f2c6aac 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -18,10 +18,6 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case '', ); - /** - * This should only be called once before the tests are run. - * This is used to copy the fixtures to the phpBB install - */ static public function setUpBeforeClass() { parent::setUpBeforeClass(); @@ -30,10 +26,6 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/../extension/ext/', self::$fixtures); } - /** - * This should only be called once after the tests are run. - * This is used to remove the fixtures from the phpBB install - */ static public function tearDownAfterClass() { parent::tearDownAfterClass(); -- cgit v1.2.1 From 007cd6177630c3f70521be130a18f0139b58c184 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 11 Jun 2013 11:37:28 +0200 Subject: [ticket/11550] Specify a valid path so it's clearer that it must be a path PHPBB3-11550 --- tests/functional/extension_acp_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/functional/extension_acp_test.php') diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index b36f2c6aac..8614c0c963 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -15,7 +15,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case static private $helper; static protected $fixtures = array( - '', + './', ); static public function setUpBeforeClass() -- cgit v1.2.1