aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2014-11-12 20:34:36 +0100
committerAndreas Fischer <bantu@phpbb.com>2014-11-12 20:34:36 +0100
commit1e4ff6105a3fc34440f5b1294e574d7f8ca7c906 (patch)
tree12a03fa950b971d727abbe766359d518823205ea
parent8df63a44997a1e34575dd7f2a0d93eb47a51a562 (diff)
downloadforums-1e4ff6105a3fc34440f5b1294e574d7f8ca7c906.tar
forums-1e4ff6105a3fc34440f5b1294e574d7f8ca7c906.tar.gz
forums-1e4ff6105a3fc34440f5b1294e574d7f8ca7c906.tar.bz2
forums-1e4ff6105a3fc34440f5b1294e574d7f8ca7c906.tar.xz
forums-1e4ff6105a3fc34440f5b1294e574d7f8ca7c906.zip
[ticket/13325] Make installing composer dependencies in tests folder optional.
Make phpbb_ui_test_case available unconditionally. Nothing depends on 5.3.19 here. Remove __init__ include. Composer classmap autoloading ensures classes can be loaded. PHPBB3-13325
-rw-r--r--tests/bootstrap.php5
-rw-r--r--tests/test_framework/phpbb_ui_test_case.php14
2 files changed, 16 insertions, 3 deletions
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 65447eb95c..0e81f4372a 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -33,8 +33,9 @@ require_once 'test_framework/phpbb_test_case.php';
require_once 'test_framework/phpbb_database_test_case.php';
require_once 'test_framework/phpbb_database_test_connection_manager.php';
require_once 'test_framework/phpbb_functional_test_case.php';
+require_once 'test_framework/phpbb_ui_test_case.php';
-if (version_compare(PHP_VERSION,'5.3.19', ">="))
+if (version_compare(PHP_VERSION, '5.3.19', ">=") && file_exists(__DIR__ . '/vendor/autoload.php'))
{
- require_once 'test_framework/phpbb_ui_test_case.php';
+ require_once __DIR__ . '/vendor/autoload.php';
}
diff --git a/tests/test_framework/phpbb_ui_test_case.php b/tests/test_framework/phpbb_ui_test_case.php
index b23781ee21..c8ac492e25 100644
--- a/tests/test_framework/phpbb_ui_test_case.php
+++ b/tests/test_framework/phpbb_ui_test_case.php
@@ -10,7 +10,7 @@
* the docs/CREDITS.txt file.
*
*/
-require_once __DIR__ . '/../vendor/facebook/webdriver/lib/__init__.php';
+
require_once __DIR__ . '/../../phpBB/includes/functions_install.php';
class phpbb_ui_test_case extends phpbb_test_case
@@ -31,6 +31,18 @@ class phpbb_ui_test_case extends phpbb_test_case
{
parent::setUpBeforeClass();
+ if (version_compare(PHP_VERSION, '5.3.19', '<'))
+ {
+ self::markTestSkipped('UI test case requires at least PHP 5.3.19.');
+ }
+ else if (!class_exists('\RemoteWebDriver'))
+ {
+ self::markTestSkipped(
+ 'Could not find RemoteWebDriver class. ' .
+ 'Run "php ../composer.phar install" from the tests folder.'
+ );
+ }
+
self::$config = phpbb_test_case_helpers::get_test_config();
self::$root_url = self::$config['phpbb_functional_url'];