[ticket/11491] Only copy files from phpBB/ext/ the directory exists

PHPBB3-11491
This commit is contained in:
Joas Schilling 2013-04-12 02:03:58 +02:00
parent 0b64db275b
commit 3436e3f102

View file

@ -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/'));