From 3436e3f1020cce0a7d78edb7517335dfa6645024 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 12 Apr 2013 02:03:58 +0200 Subject: [PATCH] [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/'));