Merge pull request #3141 from bantu/ticket/13325

[ticket/13325] Make installing composer dependencies in tests folder optional.
This commit is contained in:
Marc Alexander 2014-11-13 17:11:48 +01:00
commit c9db08873f
3 changed files with 18 additions and 5 deletions

View file

@ -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_case.php';
require_once 'test_framework/phpbb_database_test_connection_manager.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_functional_test_case.php';
if (version_compare(PHP_VERSION,'5.3.19', ">="))
{
require_once 'test_framework/phpbb_ui_test_case.php'; require_once 'test_framework/phpbb_ui_test_case.php';
if (version_compare(PHP_VERSION, '5.3.19', ">=") && file_exists(__DIR__ . '/vendor/autoload.php'))
{
require_once __DIR__ . '/vendor/autoload.php';
} }

2
tests/composer.lock generated
View file

@ -3,7 +3,7 @@
"This file locks the dependencies of your project to a known state", "This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
], ],
"hash": "2affca245bd4946ca7acdf46f100af3c", "hash": "cf1d8a4841e5e669b148e0df6645a788",
"packages": [ "packages": [
], ],

View file

@ -10,7 +10,7 @@
* the docs/CREDITS.txt file. * the docs/CREDITS.txt file.
* *
*/ */
require_once __DIR__ . '/../vendor/facebook/webdriver/lib/__init__.php';
require_once __DIR__ . '/../../phpBB/includes/functions_install.php'; require_once __DIR__ . '/../../phpBB/includes/functions_install.php';
class phpbb_ui_test_case extends phpbb_test_case class phpbb_ui_test_case extends phpbb_test_case
@ -31,6 +31,18 @@ class phpbb_ui_test_case extends phpbb_test_case
{ {
parent::setUpBeforeClass(); 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::$config = phpbb_test_case_helpers::get_test_config();
self::$root_url = self::$config['phpbb_functional_url']; self::$root_url = self::$config['phpbb_functional_url'];