diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php index b522866a40..464078f0e1 100644 --- a/tests/test_framework/phpbb_test_case_helpers.php +++ b/tests/test_framework/phpbb_test_case_helpers.php @@ -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/');