diff options
author | Andreas Fischer <bantu@phpbb.com> | 2013-04-15 14:56:13 -0400 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2013-04-15 14:56:13 -0400 |
commit | a0d10cd7fcf9449a025811f4adc1e9d8b1e5ac89 (patch) | |
tree | 21497d8b95c7602598ae2d2271363e5728805a75 | |
parent | fbe115b434d53b155301288a41fe8e94e1ada801 (diff) | |
parent | 13ca1f55985b4e481876e78f84f8957aa94e21f3 (diff) | |
download | forums-a0d10cd7fcf9449a025811f4adc1e9d8b1e5ac89.tar forums-a0d10cd7fcf9449a025811f4adc1e9d8b1e5ac89.tar.gz forums-a0d10cd7fcf9449a025811f4adc1e9d8b1e5ac89.tar.bz2 forums-a0d10cd7fcf9449a025811f4adc1e9d8b1e5ac89.tar.xz forums-a0d10cd7fcf9449a025811f4adc1e9d8b1e5ac89.zip |
Merge remote-tracking branch 'nickvergessen/ticket/11491' into develop
* nickvergessen/ticket/11491:
[ticket/11491] Copy files back only if we saved them previously
[ticket/11491] Only copy files from phpBB/ext/ the directory exists
[ticket/11491] Correctly remove the store/temp_ext/ directory after use
[ticket/11491] Fix path to the ext/ folder
[ticket/11491] Add extension_acp_test.php to functional group
[ticket/11491] Fix class name of functional test
[ticket/11491] Move file to correct directory
-rw-r--r-- | tests/functional/extension_acp_test.php (renamed from tests/extension/acp.php) | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/tests/extension/acp.php b/tests/functional/extension_acp_test.php index 790df77c0d..1879cbd62c 100644 --- a/tests/extension/acp.php +++ b/tests/functional/extension_acp_test.php @@ -7,7 +7,10 @@ * */ -class acp_test extends phpbb_functional_test_case +/** +* @group functional +*/ +class phpbb_functional_extension_acp_test extends phpbb_functional_test_case { static private $copied_files = array(); static private $helper; @@ -24,14 +27,19 @@ class 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__) . '/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() @@ -84,13 +92,19 @@ class 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/'); - - self::$copied_files[] = $phpbb_root_path . 'store/temp_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); + + if (file_exists($phpbb_root_path . 'store/temp_ext/')) + { + self::$helper->empty_dir($phpbb_root_path . 'store/temp_ext/'); + } } public function test_list() |