aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/extension_module_test.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2013-06-11 14:35:54 +0200
committerAndreas Fischer <bantu@phpbb.com>2013-06-11 14:35:54 +0200
commitfba093de0578881b78128c5faa71a5194fe24b4e (patch)
tree61ef00b7ba2994589c78001fe9dcb063bc06dca1 /tests/functional/extension_module_test.php
parente5d02f4b0caf8dbac7acdb44b096d28660977cd2 (diff)
parent007cd6177630c3f70521be130a18f0139b58c184 (diff)
downloadforums-fba093de0578881b78128c5faa71a5194fe24b4e.tar
forums-fba093de0578881b78128c5faa71a5194fe24b4e.tar.gz
forums-fba093de0578881b78128c5faa71a5194fe24b4e.tar.bz2
forums-fba093de0578881b78128c5faa71a5194fe24b4e.tar.xz
forums-fba093de0578881b78128c5faa71a5194fe24b4e.zip
Merge remote-tracking branch 'nickvergessen/ticket/11550' into develop
* nickvergessen/ticket/11550: [ticket/11550] Specify a valid path so it's clearer that it must be a path [ticket/11550] Move comments to correct function [ticket/11550] We use a different fixture set for extension_acp_test.php [ticket/11550] Fixtures should only be directories not files [ticket/11550] Use new functionality from the test case helpers [ticket/11550] Move functionality for copying/restoring to test case helpers [ticket/11550] Fix copying the fixtures in extension_permission_lang_test.php
Diffstat (limited to 'tests/functional/extension_module_test.php')
-rw-r--r--tests/functional/extension_module_test.php46
1 files changed, 8 insertions, 38 deletions
diff --git a/tests/functional/extension_module_test.php b/tests/functional/extension_module_test.php
index c8686e0ac6..c573ea5410 100644
--- a/tests/functional/extension_module_test.php
+++ b/tests/functional/extension_module_test.php
@@ -16,56 +16,26 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/acp/acp_modules.php';
class phpbb_functional_extension_module_test extends phpbb_functional_test_case
{
protected $phpbb_extension_manager;
- static private $copied_files = array();
+
static private $helper;
- /**
- * This should only be called once before the tests are run.
- * This is used to copy the fixtures to the phpBB install
- */
+ static protected $fixtures = array(
+ './',
+ );
+
static public function setUpBeforeClass()
{
- global $phpbb_root_path;
parent::setUpBeforeClass();
self::$helper = new phpbb_test_case_helpers(self);
-
- self::$copied_files = array();
-
- 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__) . '/fixtures/ext/', $phpbb_root_path . 'ext/'));
+ self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures);
}
- /**
- * This should only be called once after the tests are run.
- * This is used to remove the fixtures from the phpBB install
- */
static public function tearDownAfterClass()
{
- global $phpbb_root_path;
-
- 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);
+ parent::tearDownAfterClass();
- if (file_exists($phpbb_root_path . 'store/temp_ext/'))
- {
- self::$helper->empty_dir($phpbb_root_path . 'store/temp_ext/');
- }
+ self::$helper->restore_original_ext_dir();
}
public function setUp()