mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Merge remote-tracking branch 'nickvergessen/ticket/11491' into develop
* nickvergessen/ticket/11491: [ticket/11491] Copy files back only if we saved them previously [ticket/11491] Only copy files from phpBB/ext/ the directory exists [ticket/11491] Correctly remove the store/temp_ext/ directory after use [ticket/11491] Fix path to the ext/ folder [ticket/11491] Add extension_acp_test.php to functional group [ticket/11491] Fix class name of functional test [ticket/11491] Move file to correct directory
This commit is contained in:
commit
a0d10cd7fc
1 changed files with 24 additions and 10 deletions
|
@ -7,7 +7,10 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class acp_test extends phpbb_functional_test_case
|
/**
|
||||||
|
* @group functional
|
||||||
|
*/
|
||||||
|
class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
|
||||||
{
|
{
|
||||||
static private $copied_files = array();
|
static private $copied_files = array();
|
||||||
static private $helper;
|
static private $helper;
|
||||||
|
@ -24,14 +27,19 @@ class acp_test extends phpbb_functional_test_case
|
||||||
|
|
||||||
self::$helper = new phpbb_test_case_helpers(self);
|
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
|
// 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 = 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)
|
// Then empty the ext/ directory on the board (for accurate test cases)
|
||||||
self::$helper->empty_dir($phpbb_root_path . 'ext/');
|
self::$helper->empty_dir($phpbb_root_path . 'ext/');
|
||||||
|
}
|
||||||
|
|
||||||
// Copy our ext/ files from the test case to the board
|
// 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__) . '/ext/', $phpbb_root_path . 'ext/'));
|
self::$copied_files = array_merge(self::$copied_files, self::$helper->copy_dir(dirname(__FILE__) . '/../extension/ext/', $phpbb_root_path . 'ext/'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
|
@ -84,13 +92,19 @@ class acp_test extends phpbb_functional_test_case
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
global $phpbb_root_path;
|
||||||
|
|
||||||
|
if (file_exists($phpbb_root_path . 'store/temp_ext/'))
|
||||||
|
{
|
||||||
// Copy back the board installed extensions from the temp directory
|
// Copy back the board installed extensions from the temp directory
|
||||||
self::$helper->copy_dir($phpbb_root_path . 'store/temp_ext/', $phpbb_root_path . 'ext/');
|
self::$helper->copy_dir($phpbb_root_path . 'store/temp_ext/', $phpbb_root_path . 'ext/');
|
||||||
|
}
|
||||||
self::$copied_files[] = $phpbb_root_path . 'store/temp_ext/';
|
|
||||||
|
|
||||||
// Remove all of the files we copied around (from board ext -> temp_ext, from test ext -> board 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);
|
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()
|
public function test_list()
|
Loading…
Add table
Reference in a new issue