aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMate Bartus <mate.bartus@gmail.com>2016-02-12 14:26:32 +0100
committerMate Bartus <mate.bartus@gmail.com>2016-02-12 14:31:29 +0100
commitd63b5a1315ecf819a412db382c1adcfa39fd9813 (patch)
treeabd50652b106ec21fb2a3b3b44bd052d68adcd88 /tests
parent68091561abef2c2f0674e3a461401f10f2ef5a25 (diff)
downloadforums-d63b5a1315ecf819a412db382c1adcfa39fd9813.tar
forums-d63b5a1315ecf819a412db382c1adcfa39fd9813.tar.gz
forums-d63b5a1315ecf819a412db382c1adcfa39fd9813.tar.bz2
forums-d63b5a1315ecf819a412db382c1adcfa39fd9813.tar.xz
forums-d63b5a1315ecf819a412db382c1adcfa39fd9813.zip
[ticket/14462] Fix installation in tests
PHPBB3-14462
Diffstat (limited to 'tests')
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php18
-rw-r--r--tests/test_framework/phpbb_ui_test_case.php21
-rw-r--r--tests/ui/quick_links_test.php1
3 files changed, 27 insertions, 13 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 34fbcec0e2..5083e7bdfa 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -20,6 +20,7 @@ class phpbb_functional_test_case extends phpbb_test_case
static protected $client;
static protected $cookieJar;
static protected $root_url;
+ static protected $install_success = false;
protected $cache = null;
protected $db = null;
@@ -78,6 +79,11 @@ class phpbb_functional_test_case extends phpbb_test_case
{
parent::setUp();
+ if (!self::$install_success)
+ {
+ $this->fail('Installing phpBB has failed.');
+ }
+
$this->bootstrap();
self::$cookieJar = new CookieJar;
@@ -360,17 +366,17 @@ class phpbb_functional_test_case extends phpbb_test_case
$iohandler->set_input('script_path', $parseURL['path']);
$iohandler->set_input('submit_server', 'submit');
- do
- {
- $installer->run();
- }
- while (file_exists($phpbb_root_path . 'store/install_config.php'));
+ $installer->run();
copy($config_file, $config_file_test);
- if (file_exists($phpbb_root_path . 'cache/install_lock'))
+ self::$install_success = true;
+
+ if (file_exists($phpbb_root_path . 'cache/install_lock') || file_exists($phpbb_root_path . 'store/install_config.php'))
{
+ self::$install_success = false;
unlink($phpbb_root_path . 'cache/install_lock');
+ unlink($phpbb_root_path . 'store/install_config.php');
}
global $phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template;
diff --git a/tests/test_framework/phpbb_ui_test_case.php b/tests/test_framework/phpbb_ui_test_case.php
index e118801972..59f3bdf242 100644
--- a/tests/test_framework/phpbb_ui_test_case.php
+++ b/tests/test_framework/phpbb_ui_test_case.php
@@ -26,6 +26,7 @@ class phpbb_ui_test_case extends phpbb_test_case
static protected $config;
static protected $root_url;
static protected $already_installed = false;
+ static protected $install_success = false;
static public function setUpBeforeClass()
{
@@ -74,6 +75,14 @@ class phpbb_ui_test_case extends phpbb_test_case
}
}
+ public function setUp()
+ {
+ if (!self::$install_success)
+ {
+ $this->fail('Installing phpBB has failed.');
+ }
+ }
+
static public function visit($path)
{
self::$webDriver->get(self::$root_url . $path);
@@ -194,17 +203,17 @@ class phpbb_ui_test_case extends phpbb_test_case
$iohandler->set_input('script_path', $parseURL['path']);
$iohandler->set_input('submit_server', 'submit');
- do
- {
- $installer->run();
- }
- while (file_exists($phpbb_root_path . 'store/install_config.php'));
+ $installer->run();
copy($config_file, $config_file_test);
- if (file_exists($phpbb_root_path . 'cache/install_lock'))
+ self::$install_success = true;
+
+ if (file_exists($phpbb_root_path . 'cache/install_lock') || file_exists($phpbb_root_path . 'store/install_config.php'))
{
+ self::$install_success = false;
unlink($phpbb_root_path . 'cache/install_lock');
+ unlink($phpbb_root_path . 'store/install_config.php');
}
global $phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template;
diff --git a/tests/ui/quick_links_test.php b/tests/ui/quick_links_test.php
index 5bddb44a8b..582aeafcae 100644
--- a/tests/ui/quick_links_test.php
+++ b/tests/ui/quick_links_test.php
@@ -16,7 +16,6 @@
*/
class quick_links_test extends phpbb_ui_test_case
{
-
public function test_quick_links()
{
$this->visit('index.php');