From 35064086377c3f3334e02ca153b008b0502fbdee Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 8 Jun 2013 15:26:35 +0200 Subject: [PATCH 1/7] [ticket/11550] Fix copying the fixtures in extension_permission_lang_test.php PHPBB3-11550 --- tests/functional/extension_permission_lang_test.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/functional/extension_permission_lang_test.php b/tests/functional/extension_permission_lang_test.php index 9a251e8645..04c3a9d497 100644 --- a/tests/functional/extension_permission_lang_test.php +++ b/tests/functional/extension_permission_lang_test.php @@ -45,7 +45,10 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t } // 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/' . $fixture, $phpbb_root_path . 'ext/' . $fixture)); + foreach (self::$fixtures as $fixture) + { + self::$copied_files = array_merge(self::$copied_files, self::$helper->copy_dir(dirname(__FILE__) . '/fixtures/ext/' . $fixture, $phpbb_root_path . 'ext/' . $fixture)); + } } /** From c8ee6cb0c200b7e64ebbae11806f4daddfd8d93d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 8 Jun 2013 17:00:27 +0200 Subject: [PATCH 2/7] [ticket/11550] Move functionality for copying/restoring to test case helpers PHPBB3-11550 --- .../phpbb_test_case_helpers.php | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php index 20ae384f21..0e0b5c2a8f 100644 --- a/tests/test_framework/phpbb_test_case_helpers.php +++ b/tests/test_framework/phpbb_test_case_helpers.php @@ -18,6 +18,50 @@ class phpbb_test_case_helpers $this->test_case = $test_case; } + private $copied_files = array(); + + public function copy_ext_fixtures($fixtures_dir, $fixtures) + { + global $phpbb_root_path; + + $this->copied_files = array(); + + if (file_exists($phpbb_root_path . 'ext/')) + { + // First, move any extensions setup on the board to a temp directory + $this->copied_files = $this->copy_dir($phpbb_root_path . 'ext/', $phpbb_root_path . 'store/temp_ext/'); + + // Then empty the ext/ directory on the board (for accurate test cases) + $this->empty_dir($phpbb_root_path . 'ext/'); + } + + // Copy our ext/ files from the test case to the board + foreach ($fixtures as $fixture) + { + $this->copied_files = array_merge($this->copied_files, $this->copy_dir($fixtures_dir . 'ext/' . $fixture, $phpbb_root_path . 'ext/' . $fixture)); + } + } + + public function restore_original_ext_dir() + { + global $phpbb_root_path; + + // 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 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/')) + { + $this->empty_dir($phpbb_root_path . 'store/temp_ext/'); + } + } + public function setExpectedTriggerError($errno, $message = '') { $exceptionName = ''; From a61ab1e5e4bbe786d3f500438bb0dd6ca395989e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 8 Jun 2013 17:02:31 +0200 Subject: [PATCH 3/7] [ticket/11550] Use new functionality from the test case helpers Instead of duplicating the extension copy code, it is now in the helpers. So we remove the code from existing tests. PHPBB3-11550 --- tests/functional/extension_acp_test.php | 54 ++++++------------- .../functional/extension_controller_test.php | 41 +++----------- tests/functional/extension_module_test.php | 38 +++---------- .../extension_permission_lang_test.php | 37 ++----------- tests/functional/metadata_manager_test.php | 24 ++------- .../phpbb_test_case_helpers.php | 2 +- 6 files changed, 38 insertions(+), 158 deletions(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 9badab8ced..ada17397d7 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -12,34 +12,33 @@ */ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case { - static private $copied_files = array(); static private $helper; + static protected $fixtures = array( + '', + ); + /** * This should only be called once before the tests are run. - * This is used to copy the extensions to the phpBB install + * This is used to copy the fixtures to the phpBB install */ static public function setUpBeforeClass() { - global $phpbb_root_path; - parent::setUpBeforeClass(); self::$helper = new phpbb_test_case_helpers(self); + self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures); + } - self::$copied_files = array(); + /** + * 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() + { + parent::tearDownAfterClass(); - 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/')); + self::$helper->restore_original_ext_dir(); } public function setUp() @@ -84,29 +83,6 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->add_lang('acp/extensions'); } - /** - * This should only be called once after the tests are run. - * This is used to remove the files copied to 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); - - if (file_exists($phpbb_root_path . 'store/temp_ext/')) - { - self::$helper->empty_dir($phpbb_root_path . 'store/temp_ext/'); - } - } - public function test_list() { $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid); diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php index a09035cb2b..c789ea160d 100644 --- a/tests/functional/extension_controller_test.php +++ b/tests/functional/extension_controller_test.php @@ -15,6 +15,8 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c { protected $phpbb_extension_manager; + static private $helper; + static protected $fixtures = array( 'foo/bar/config/routing.yml', 'foo/bar/config/services.yml', @@ -28,30 +30,10 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c */ static public function setUpBeforeClass() { - global $phpbb_root_path; parent::setUpBeforeClass(); - $directories = array( - $phpbb_root_path . 'ext/foo/bar/', - $phpbb_root_path . 'ext/foo/bar/config/', - $phpbb_root_path . 'ext/foo/bar/controller/', - $phpbb_root_path . 'ext/foo/bar/styles/prosilver/template', - ); - - foreach ($directories as $dir) - { - if (!is_dir($dir)) - { - mkdir($dir, 0777, true); - } - } - - foreach (self::$fixtures as $fixture) - { - copy( - "tests/functional/fixtures/ext/$fixture", - "{$phpbb_root_path}ext/$fixture"); - } + self::$helper = new phpbb_test_case_helpers(self); + self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures); } /** @@ -60,20 +42,9 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c */ static public function tearDownAfterClass() { - global $phpbb_root_path; + parent::tearDownAfterClass(); - foreach (self::$fixtures as $fixture) - { - unlink("{$phpbb_root_path}ext/$fixture"); - } - - rmdir("{$phpbb_root_path}ext/foo/bar/config"); - rmdir("{$phpbb_root_path}ext/foo/bar/controller"); - rmdir("{$phpbb_root_path}ext/foo/bar/styles/prosilver/template"); - rmdir("{$phpbb_root_path}ext/foo/bar/styles/prosilver"); - rmdir("{$phpbb_root_path}ext/foo/bar/styles"); - rmdir("{$phpbb_root_path}ext/foo/bar"); - rmdir("{$phpbb_root_path}ext/foo"); + self::$helper->restore_original_ext_dir(); } public function setUp() diff --git a/tests/functional/extension_module_test.php b/tests/functional/extension_module_test.php index c8686e0ac6..e95f0b7e3f 100644 --- a/tests/functional/extension_module_test.php +++ b/tests/functional/extension_module_test.php @@ -16,33 +16,23 @@ 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; + static protected $fixtures = array( + '', + ); + /** * This should only be called once before the tests are run. * This is used to copy the fixtures to the phpBB install */ 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); } /** @@ -51,21 +41,9 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case */ static public function tearDownAfterClass() { - global $phpbb_root_path; + parent::tearDownAfterClass(); - 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/'); - } + self::$helper->restore_original_ext_dir(); } public function setUp() diff --git a/tests/functional/extension_permission_lang_test.php b/tests/functional/extension_permission_lang_test.php index 04c3a9d497..fe8ea95cf0 100644 --- a/tests/functional/extension_permission_lang_test.php +++ b/tests/functional/extension_permission_lang_test.php @@ -16,8 +16,6 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t static private $helper; - static private $copied_files = array(); - static protected $fixtures = array( 'foo/bar/language/en/', ); @@ -28,27 +26,10 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t */ 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 - foreach (self::$fixtures as $fixture) - { - self::$copied_files = array_merge(self::$copied_files, self::$helper->copy_dir(dirname(__FILE__) . '/fixtures/ext/' . $fixture, $phpbb_root_path . 'ext/' . $fixture)); - } + self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures); } /** @@ -57,21 +38,9 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t */ 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/'); - } + parent::tearDownAfterClass(); - // 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/'); - } + self::$helper->restore_original_ext_dir(); } public function setUp() diff --git a/tests/functional/metadata_manager_test.php b/tests/functional/metadata_manager_test.php index 7e98b0d025..9d36a41354 100644 --- a/tests/functional/metadata_manager_test.php +++ b/tests/functional/metadata_manager_test.php @@ -16,7 +16,7 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case { protected $phpbb_extension_manager; - static private $helpers; + static private $helper; static protected $fixtures = array( 'foo/bar/', @@ -28,20 +28,10 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case */ static public function setUpBeforeClass() { - global $phpbb_root_path; parent::setUpBeforeClass(); - self::$helpers = new phpbb_test_case_helpers(self); - - if (!file_exists($phpbb_root_path . 'ext/foo/bar/')) - { - self::$helpers->makedirs($phpbb_root_path . 'ext/foo/bar/'); - } - - foreach (self::$fixtures as $fixture) - { - self::$helpers->copy_dir(dirname(__FILE__) . '/fixtures/ext/' . $fixture, $phpbb_root_path . 'ext/' . $fixture); - } + self::$helper = new phpbb_test_case_helpers(self); + self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures); } /** @@ -50,13 +40,9 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case */ static public function tearDownAfterClass() { - global $phpbb_root_path; + parent::tearDownAfterClass(); - foreach (self::$fixtures as $fixture) - { - self::$helpers->empty_dir($phpbb_root_path . 'ext/' . $fixture); - } - self::$helpers->empty_dir($phpbb_root_path . 'ext/foo/'); + self::$helper->restore_original_ext_dir(); } public function setUp() diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php index 0e0b5c2a8f..367bd3b142 100644 --- a/tests/test_framework/phpbb_test_case_helpers.php +++ b/tests/test_framework/phpbb_test_case_helpers.php @@ -38,7 +38,7 @@ class phpbb_test_case_helpers // Copy our ext/ files from the test case to the board foreach ($fixtures as $fixture) { - $this->copied_files = array_merge($this->copied_files, $this->copy_dir($fixtures_dir . 'ext/' . $fixture, $phpbb_root_path . 'ext/' . $fixture)); + $this->copied_files = array_merge($this->copied_files, $this->copy_dir($fixtures_dir . $fixture, $phpbb_root_path . 'ext/' . $fixture)); } } From 7546c3a7a76a7293b3c1524097098f3f19c39666 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 8 Jun 2013 17:14:20 +0200 Subject: [PATCH 4/7] [ticket/11550] Fixtures should only be directories not files PHPBB3-11550 --- tests/functional/extension_controller_test.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php index c789ea160d..ea5a51291d 100644 --- a/tests/functional/extension_controller_test.php +++ b/tests/functional/extension_controller_test.php @@ -18,10 +18,9 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c static private $helper; static protected $fixtures = array( - 'foo/bar/config/routing.yml', - 'foo/bar/config/services.yml', - 'foo/bar/controller/controller.php', - 'foo/bar/styles/prosilver/template/foo_bar_body.html', + 'foo/bar/config/', + 'foo/bar/controller/', + 'foo/bar/styles/prosilver/template/', ); /** From 0b3f18208354aabc5b9c8901c2950e9626c3e5f3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 9 Jun 2013 17:40:33 +0200 Subject: [PATCH 5/7] [ticket/11550] We use a different fixture set for extension_acp_test.php PHPBB3-11550 --- tests/functional/extension_acp_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index ada17397d7..5f8e3762a6 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -27,7 +27,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case parent::setUpBeforeClass(); self::$helper = new phpbb_test_case_helpers(self); - self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/fixtures/ext/', self::$fixtures); + self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/../extension/ext/', self::$fixtures); } /** From 68d15f0f14dfdc827e1169a73c194a9e30795605 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 11 Jun 2013 11:14:24 +0200 Subject: [PATCH 6/7] [ticket/11550] Move comments to correct function PHPBB3-11550 --- tests/functional/extension_acp_test.php | 8 -------- tests/functional/extension_controller_test.php | 8 -------- tests/functional/extension_module_test.php | 8 -------- tests/functional/extension_permission_lang_test.php | 8 -------- tests/functional/metadata_manager_test.php | 8 -------- tests/test_framework/phpbb_test_case_helpers.php | 8 ++++++++ 6 files changed, 8 insertions(+), 40 deletions(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 5f8e3762a6..b36f2c6aac 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -18,10 +18,6 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case '', ); - /** - * This should only be called once before the tests are run. - * This is used to copy the fixtures to the phpBB install - */ static public function setUpBeforeClass() { parent::setUpBeforeClass(); @@ -30,10 +26,6 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case self::$helper->copy_ext_fixtures(dirname(__FILE__) . '/../extension/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() { parent::tearDownAfterClass(); diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php index ea5a51291d..9ddf1e3e5c 100644 --- a/tests/functional/extension_controller_test.php +++ b/tests/functional/extension_controller_test.php @@ -23,10 +23,6 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c 'foo/bar/styles/prosilver/template/', ); - /** - * This should only be called once before the tests are run. - * This is used to copy the fixtures to the phpBB install - */ static public function setUpBeforeClass() { parent::setUpBeforeClass(); @@ -35,10 +31,6 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c 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() { parent::tearDownAfterClass(); diff --git a/tests/functional/extension_module_test.php b/tests/functional/extension_module_test.php index e95f0b7e3f..12113bedac 100644 --- a/tests/functional/extension_module_test.php +++ b/tests/functional/extension_module_test.php @@ -23,10 +23,6 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case '', ); - /** - * This should only be called once before the tests are run. - * This is used to copy the fixtures to the phpBB install - */ static public function setUpBeforeClass() { parent::setUpBeforeClass(); @@ -35,10 +31,6 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case 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() { parent::tearDownAfterClass(); diff --git a/tests/functional/extension_permission_lang_test.php b/tests/functional/extension_permission_lang_test.php index fe8ea95cf0..6c1720735c 100644 --- a/tests/functional/extension_permission_lang_test.php +++ b/tests/functional/extension_permission_lang_test.php @@ -20,10 +20,6 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t 'foo/bar/language/en/', ); - /** - * This should only be called once before the tests are run. - * This is used to copy the fixtures to the phpBB install - */ static public function setUpBeforeClass() { parent::setUpBeforeClass(); @@ -32,10 +28,6 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t 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() { parent::tearDownAfterClass(); diff --git a/tests/functional/metadata_manager_test.php b/tests/functional/metadata_manager_test.php index 9d36a41354..c55e7373ea 100644 --- a/tests/functional/metadata_manager_test.php +++ b/tests/functional/metadata_manager_test.php @@ -22,10 +22,6 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case 'foo/bar/', ); - /** - * This should only be called once before the tests are run. - * This is used to copy the fixtures to the phpBB install - */ static public function setUpBeforeClass() { parent::setUpBeforeClass(); @@ -34,10 +30,6 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case 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() { parent::tearDownAfterClass(); diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php index 367bd3b142..1b08f2368f 100644 --- a/tests/test_framework/phpbb_test_case_helpers.php +++ b/tests/test_framework/phpbb_test_case_helpers.php @@ -20,6 +20,10 @@ class phpbb_test_case_helpers private $copied_files = array(); + /** + * This should only be called once before the tests are run. + * This is used to copy the fixtures to the phpBB install + */ public function copy_ext_fixtures($fixtures_dir, $fixtures) { global $phpbb_root_path; @@ -42,6 +46,10 @@ class phpbb_test_case_helpers } } + /** + * This should only be called once after the tests are run. + * This is used to remove the fixtures from the phpBB install + */ public function restore_original_ext_dir() { global $phpbb_root_path; From 007cd6177630c3f70521be130a18f0139b58c184 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 11 Jun 2013 11:37:28 +0200 Subject: [PATCH 7/7] [ticket/11550] Specify a valid path so it's clearer that it must be a path PHPBB3-11550 --- tests/functional/extension_acp_test.php | 2 +- tests/functional/extension_module_test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index b36f2c6aac..8614c0c963 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -15,7 +15,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case static private $helper; static protected $fixtures = array( - '', + './', ); static public function setUpBeforeClass() diff --git a/tests/functional/extension_module_test.php b/tests/functional/extension_module_test.php index 12113bedac..c573ea5410 100644 --- a/tests/functional/extension_module_test.php +++ b/tests/functional/extension_module_test.php @@ -20,7 +20,7 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case static private $helper; static protected $fixtures = array( - '', + './', ); static public function setUpBeforeClass()