aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-12-04 17:37:46 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2012-12-04 17:37:46 -0500
commit38d2868ba8db0f6e24fdfb7bbdfef4925a97770c (patch)
treea04411b114dea9104b6ae78e406ed3141da72a99 /tests/test_framework
parentbdc3ddf2bcec3caa9047d03e954c9de82f4916aa (diff)
downloadforums-38d2868ba8db0f6e24fdfb7bbdfef4925a97770c.tar
forums-38d2868ba8db0f6e24fdfb7bbdfef4925a97770c.tar.gz
forums-38d2868ba8db0f6e24fdfb7bbdfef4925a97770c.tar.bz2
forums-38d2868ba8db0f6e24fdfb7bbdfef4925a97770c.tar.xz
forums-38d2868ba8db0f6e24fdfb7bbdfef4925a97770c.zip
[ticket/10491] Move board installation into setup before class.
Functional posting test already assumed that board is installed once per test case and not once per test. PHPBB3-10491
Diffstat (limited to 'tests/test_framework')
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php28
1 files changed, 12 insertions, 16 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 85019a5e31..66f4b6db65 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -31,7 +31,6 @@ class phpbb_functional_test_case extends phpbb_test_case
protected $lang = array();
static protected $config = array();
- static protected $already_installed = false;
static public function setUpBeforeClass()
{
@@ -43,18 +42,15 @@ class phpbb_functional_test_case extends phpbb_test_case
{
self::markTestSkipped('phpbb_functional_url was not set in test_config and wasn\'t set as PHPBB_FUNCTIONAL_URL environment variable either.');
}
+
+ self::install_board();
}
public function setUp()
{
parent::setUp();
- if (!static::$already_installed)
- {
- $this->install_board();
- $this->bootstrap();
- static::$already_installed = true;
- }
+ $this->bootstrap();
$this->cookieJar = new CookieJar;
$this->client = new Goutte\Client(array(), null, $this->cookieJar);
@@ -109,12 +105,12 @@ class phpbb_functional_test_case extends phpbb_test_case
);
}
- protected function install_board()
+ static protected function install_board()
{
global $phpbb_root_path, $phpEx;
self::$config['table_prefix'] = 'phpbb_';
- $this->recreate_database(self::$config);
+ self::recreate_database(self::$config);
if (file_exists($phpbb_root_path . "config.$phpEx"))
{
@@ -159,20 +155,20 @@ class phpbb_functional_test_case extends phpbb_test_case
));
// end data
- $content = $this->do_request('install');
- $this->assertNotSame(false, $content);
- $this->assertContains('Welcome to Installation', $content);
+ $content = self::do_request('install');
+ self::assertNotSame(false, $content);
+ self::assertContains('Welcome to Installation', $content);
- $this->do_request('create_table', $data);
+ self::do_request('create_table', $data);
- $this->do_request('config_file', $data);
+ self::do_request('config_file', $data);
file_put_contents($phpbb_root_path . "config.$phpEx", phpbb_create_config_file_data($data, self::$config['dbms'], array(), true, true));
- $this->do_request('final', $data);
+ self::do_request('final', $data);
copy($phpbb_root_path . "config.$phpEx", $phpbb_root_path . "config_test.$phpEx");
}
- private function do_request($sub, $post_data = null)
+ static private function do_request($sub, $post_data = null)
{
$context = null;