mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/17049] Backup and restore composer-ext data for tests
PHPBB3-17049
This commit is contained in:
parent
42670686da
commit
7a5a32fc57
1 changed files with 30 additions and 0 deletions
|
@ -37,8 +37,19 @@ class phpbb_test_case_helpers
|
|||
// First, move any extensions setup on the board to a temp directory
|
||||
$this->copy_dir($phpbb_root_path . 'ext/', $phpbb_root_path . 'store/temp_ext/');
|
||||
|
||||
// Back up vendor-ext directory
|
||||
$this->copy_dir($phpbb_root_path . 'vendor-ext/', $phpbb_root_path . 'store/temp_vendor-ext/');
|
||||
|
||||
// Back up composer-ext.* files
|
||||
copy($phpbb_root_path . 'composer-ext.json', $phpbb_root_path . 'store/temp_composer-ext.json');
|
||||
copy($phpbb_root_path . 'composer-ext.lock', $phpbb_root_path . 'store/temp_composer-ext.lock');
|
||||
|
||||
// Then empty the ext/ directory on the board (for accurate test cases)
|
||||
$this->empty_dir($phpbb_root_path . 'ext/');
|
||||
|
||||
// Then empty the vendor-ext/ directory and add back .git-keep
|
||||
$this->empty_dir($phpbb_root_path . 'vendor-ext/');
|
||||
file_put_contents($phpbb_root_path . 'vendor-ext/.git-keep', '');
|
||||
}
|
||||
|
||||
// Copy our ext/ files from the test case to the board
|
||||
|
@ -68,6 +79,25 @@ class phpbb_test_case_helpers
|
|||
$this->empty_dir($phpbb_root_path . 'store/temp_ext/');
|
||||
}
|
||||
|
||||
if (file_exists($phpbb_root_path . 'store/temp_vendor-ext/'))
|
||||
{
|
||||
$this->empty_dir($phpbb_root_path . 'vendor-ext/');
|
||||
|
||||
$this->copy_dir($phpbb_root_path . 'store/temp_vendor-ext/', $phpbb_root_path . 'vendor-ext/');
|
||||
|
||||
$this->empty_dir($phpbb_root_path . 'store/temp_vendor-ext/');
|
||||
}
|
||||
|
||||
if (file_exists($phpbb_root_path . 'store/temp_composer-ext.json'))
|
||||
{
|
||||
copy($phpbb_root_path . 'store/temp_composer-ext.json', $phpbb_root_path . 'composer-ext.json');
|
||||
}
|
||||
|
||||
if (file_exists($phpbb_root_path . 'store/temp_composer-ext.lock'))
|
||||
{
|
||||
copy($phpbb_root_path . 'store/temp_composer-ext.lock', $phpbb_root_path . 'composer-ext.lock');
|
||||
}
|
||||
|
||||
if (file_exists($phpbb_root_path . 'store/temp_ext/'))
|
||||
{
|
||||
$this->empty_dir($phpbb_root_path . 'store/temp_ext/');
|
||||
|
|
Loading…
Add table
Reference in a new issue