aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-06-11 16:03:34 +0200
committerJoas Schilling <nickvergessen@gmx.de>2013-06-11 16:03:34 +0200
commitd02f98c63530454700661fc80354d66207ed8b02 (patch)
treea3cf4dada6860cf08125ea7347a92056747a4a6b /tests
parent6f86c1dc7643c8f6928cb4f33322bc4447c0b9fc (diff)
downloadforums-d02f98c63530454700661fc80354d66207ed8b02.tar
forums-d02f98c63530454700661fc80354d66207ed8b02.tar.gz
forums-d02f98c63530454700661fc80354d66207ed8b02.tar.bz2
forums-d02f98c63530454700661fc80354d66207ed8b02.tar.xz
forums-d02f98c63530454700661fc80354d66207ed8b02.zip
[ticket/11605] Use empty_dir to better delete files and dirs of extensions
PHPBB3-11605
Diffstat (limited to 'tests')
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php29
1 files changed, 6 insertions, 23 deletions
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index 1b08f2368f..8c91d357b8 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -54,14 +54,18 @@ class phpbb_test_case_helpers
{
global $phpbb_root_path;
+ // Remove all of the files we copied from test ext -> board ext
+ $this->empty_dir($phpbb_root_path . 'ext/');
+
// Copy back the board installed extensions from the temp directory
if (file_exists($phpbb_root_path . 'store/temp_ext/'))
{
$this->copy_dir($phpbb_root_path . 'store/temp_ext/', $phpbb_root_path . 'ext/');
+
+ // Remove all of the files we copied from board ext -> temp_ext
+ $this->empty_dir($phpbb_root_path . 'store/temp_ext/');
}
- // Remove all of the files we copied around (from board ext -> temp_ext, from test ext -> board ext)
- $this->remove_files($this->copied_files);
$this->copied_files = array();
if (file_exists($phpbb_root_path . 'store/temp_ext/'))
@@ -255,27 +259,6 @@ class phpbb_test_case_helpers
}
/**
- * Remove files/directories that are listed in an array
- * Designed for use with $this->copy_dir()
- *
- * @param array $file_list
- */
- public function remove_files($file_list)
- {
- foreach ($file_list as $file)
- {
- if (is_dir($file))
- {
- rmdir($file);
- }
- else
- {
- unlink($file);
- }
- }
- }
-
- /**
* Empty directory (remove any subdirectories/files below)
*
* @param array $file_list