aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-12-04 17:19:25 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2012-12-04 17:19:25 -0500
commitbdc3ddf2bcec3caa9047d03e954c9de82f4916aa (patch)
tree98e7d4408edc59bdca496da0cf83efde6753d0fc /tests/test_framework
parente64c5117b9748208a87df80aff6012f3aae573ad (diff)
downloadforums-bdc3ddf2bcec3caa9047d03e954c9de82f4916aa.tar
forums-bdc3ddf2bcec3caa9047d03e954c9de82f4916aa.tar.gz
forums-bdc3ddf2bcec3caa9047d03e954c9de82f4916aa.tar.bz2
forums-bdc3ddf2bcec3caa9047d03e954c9de82f4916aa.tar.xz
forums-bdc3ddf2bcec3caa9047d03e954c9de82f4916aa.zip
[ticket/10491] Set up functional tests sensibly.
PHPBB_FUNCTIONAL_URL goes into setup before class. Drop PHPBB_FUNCTIONAL_URL check in board installation and silent return if it is not set. Take board installation out of constructor. Install board in setup method. PHPBB3-10491
Diffstat (limited to 'tests/test_framework')
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php35
1 files changed, 19 insertions, 16 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 7c03f874e9..85019a5e31 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -33,11 +33,27 @@ class phpbb_functional_test_case extends phpbb_test_case
static protected $config = array();
static protected $already_installed = false;
- public function setUp()
+ static public function setUpBeforeClass()
{
+ parent::setUpBeforeClass();
+
+ self::$config = phpbb_test_case_helpers::get_test_config();
+
if (!isset(self::$config['phpbb_functional_url']))
{
- $this->markTestSkipped('phpbb_functional_url was not set in test_config and wasn\'t set as PHPBB_FUNCTIONAL_URL environment variable either.');
+ self::markTestSkipped('phpbb_functional_url was not set in test_config and wasn\'t set as PHPBB_FUNCTIONAL_URL environment variable either.');
+ }
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ if (!static::$already_installed)
+ {
+ $this->install_board();
+ $this->bootstrap();
+ static::$already_installed = true;
}
$this->cookieJar = new CookieJar;
@@ -91,26 +107,12 @@ class phpbb_functional_test_case extends phpbb_test_case
$this->backupStaticAttributesBlacklist += array(
'phpbb_functional_test_case' => array('config', 'already_installed'),
);
-
- if (!static::$already_installed)
- {
- $this->install_board();
- $this->bootstrap();
- static::$already_installed = true;
- }
}
protected function install_board()
{
global $phpbb_root_path, $phpEx;
- self::$config = phpbb_test_case_helpers::get_test_config();
-
- if (!isset(self::$config['phpbb_functional_url']))
- {
- return;
- }
-
self::$config['table_prefix'] = 'phpbb_';
$this->recreate_database(self::$config);
@@ -158,6 +160,7 @@ 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);
$this->do_request('create_table', $data);