1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[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
This commit is contained in:
Joas Schilling
2013-06-08 17:02:31 +02:00
parent c8ee6cb0c2
commit a61ab1e5e4
6 changed files with 38 additions and 158 deletions

View File

@@ -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()