public static function 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('\\Facebook\\WebDriver\\Remote\\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'];
// Important: this is used both for installation and by
// test cases for querying the tables.
// Therefore table prefix must be set before a board is
// installed, and also before each test case is run.
self::$config['table_prefix'] = 'phpbb_';
if (!isset(self::$config['phpbb_functional_url'])) {
self::markTestSkipped('phpbb_functional_url was not set in test_config and wasn\'t set as PHPBB_FUNCTIONAL_URL environment variable either.');
}
if (!self::$webDriver) {
try {
$capabilities = DesiredCapabilities::firefox();
self::$webDriver = RemoteWebDriver::create(self::$host . ':' . self::$port, $capabilities);
} catch (WebDriverCurlException $e) {
self::markTestSkipped('PhantomJS webserver is not running.');
}
}
if (!self::$already_installed) {
self::install_board();
self::$already_installed = true;
}
}