From b2b8b62fad58e1c53545212074894a07d7aca6a9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 12 Apr 2013 01:08:09 +0200 Subject: [PATCH 1/7] [ticket/11491] Move file to correct directory PHPBB3-11491 --- tests/{extension/acp.php => functional/extension_acp_test.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{extension/acp.php => functional/extension_acp_test.php} (100%) diff --git a/tests/extension/acp.php b/tests/functional/extension_acp_test.php similarity index 100% rename from tests/extension/acp.php rename to tests/functional/extension_acp_test.php From 4c99229be81332b6c2bce11b98ae6538e07d141f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 12 Apr 2013 01:08:40 +0200 Subject: [PATCH 2/7] [ticket/11491] Fix class name of functional test PHPBB3-11491 --- tests/functional/extension_acp_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 790df77c0d..1ecff49353 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -7,7 +7,7 @@ * */ -class acp_test extends phpbb_functional_test_case +class phpbb_functional_extension_acp_test extends phpbb_functional_test_case { static private $copied_files = array(); static private $helper; From 08e7bd6166f28b106be28d6eb947ed950bedeaa1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 12 Apr 2013 01:09:09 +0200 Subject: [PATCH 3/7] [ticket/11491] Add extension_acp_test.php to functional group PHPBB3-11491 --- tests/functional/extension_acp_test.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 1ecff49353..399af2b452 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -7,6 +7,9 @@ * */ +/** +* @group functional +*/ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case { static private $copied_files = array(); From 56bcf7497e6b866d67d8c7e2f8b679d2190639a7 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 12 Apr 2013 01:10:09 +0200 Subject: [PATCH 4/7] [ticket/11491] Fix path to the ext/ folder PHPBB3-11491 --- tests/functional/extension_acp_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 399af2b452..4dab5ecf82 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -34,7 +34,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case self::$helper->empty_dir($phpbb_root_path . 'ext/'); // 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__) . '/ext/', $phpbb_root_path . 'ext/')); + self::$copied_files = array_merge(self::$copied_files, self::$helper->copy_dir(dirname(__FILE__) . '/../extension/ext/', $phpbb_root_path . 'ext/')); } public function setUp() From 0b64db275bae14649e09031483b03ccc1943310b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 12 Apr 2013 01:40:45 +0200 Subject: [PATCH 5/7] [ticket/11491] Correctly remove the store/temp_ext/ directory after use PHPBB3-11491 --- tests/functional/extension_acp_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 4dab5ecf82..e829e4582e 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -90,10 +90,10 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case // Copy back the board installed extensions from the temp directory self::$helper->copy_dir($phpbb_root_path . 'store/temp_ext/', $phpbb_root_path . 'ext/'); - self::$copied_files[] = $phpbb_root_path . 'store/temp_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); + + self::$helper->empty_dir($phpbb_root_path . 'store/temp_ext/'); } public function test_list() From 3436e3f1020cce0a7d78edb7517335dfa6645024 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 12 Apr 2013 02:03:58 +0200 Subject: [PATCH 6/7] [ticket/11491] Only copy files from phpBB/ext/ the directory exists PHPBB3-11491 --- tests/functional/extension_acp_test.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index e829e4582e..cb908e0f98 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -27,11 +27,16 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case self::$helper = new phpbb_test_case_helpers(self); - // 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/'); + self::$copied_files = array(); - // Then empty the ext/ directory on the board (for accurate test cases) - self::$helper->empty_dir($phpbb_root_path . 'ext/'); + 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/'); + } // 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/')); From 13ca1f55985b4e481876e78f84f8957aa94e21f3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 12 Apr 2013 02:15:37 +0200 Subject: [PATCH 7/7] [ticket/11491] Copy files back only if we saved them previously PHPBB3-11491 --- tests/functional/extension_acp_test.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index cb908e0f98..1879cbd62c 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -92,13 +92,19 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case { global $phpbb_root_path; - // Copy back the board installed extensions from the temp directory - self::$helper->copy_dir($phpbb_root_path . 'store/temp_ext/', $phpbb_root_path . 'ext/'); + 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); - self::$helper->empty_dir($phpbb_root_path . 'store/temp_ext/'); + if (file_exists($phpbb_root_path . 'store/temp_ext/')) + { + self::$helper->empty_dir($phpbb_root_path . 'store/temp_ext/'); + } } public function test_list()