mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 03:34:04 +02:00
Merge remote-tracking branch 'Fyorl/ticket/10981' into develop-olympus
* Fyorl/ticket/10981: [ticket/10981] Added check for PHP version before running composer [ticket/10981] Modified travis to use composer with --dev [ticket/10981] Removed setupBeforeClass [ticket/10981] Modified functional framework to account for goutte changes [ticket/10981] Added goutte via composer
This commit is contained in:
@@ -22,5 +22,20 @@ require_once 'test_framework/phpbb_database_test_connection_manager.php';
|
||||
|
||||
if (version_compare(PHP_VERSION, '5.3.0-dev', '>='))
|
||||
{
|
||||
if (getenv('PHPBB_NO_COMPOSER_AUTOLOAD'))
|
||||
{
|
||||
if (getenv('PHPBB_AUTOLOAD'))
|
||||
{
|
||||
require(getenv('PHPBB_AUTOLOAD'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!file_exists($phpbb_root_path . 'vendor/autoload.php'))
|
||||
{
|
||||
trigger_error('You have not set up composer dependencies. See http://getcomposer.org/.', E_USER_ERROR);
|
||||
}
|
||||
require($phpbb_root_path . 'vendor/autoload.php');
|
||||
}
|
||||
require_once 'test_framework/phpbb_functional_test_case.php';
|
||||
}
|
||||
|
@@ -30,16 +30,6 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
static protected $config = array();
|
||||
static protected $already_installed = false;
|
||||
|
||||
static public function setUpBeforeClass()
|
||||
{
|
||||
if (!extension_loaded('phar'))
|
||||
{
|
||||
self::markTestSkipped('phar extension is not loaded');
|
||||
}
|
||||
|
||||
require_once 'phar://' . __DIR__ . '/../../vendor/goutte.phar';
|
||||
}
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!isset(self::$config['phpbb_functional_url']))
|
||||
@@ -48,7 +38,10 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
}
|
||||
|
||||
$this->cookieJar = new CookieJar;
|
||||
$this->client = new Goutte\Client(array(), array(), null, $this->cookieJar);
|
||||
$this->client = new Goutte\Client(array(), null, $this->cookieJar);
|
||||
// Reset the curl handle because it is 0 at this point and not a valid
|
||||
// resource
|
||||
$this->client->getClient()->getCurlMulti()->reset(true);
|
||||
$this->root_url = self::$config['phpbb_functional_url'];
|
||||
// Clear the language array so that things
|
||||
// that were added in other tests are gone
|
||||
@@ -193,9 +186,9 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
$cookies = $this->cookieJar->all();
|
||||
|
||||
// The session id is stored in a cookie that ends with _sid - we assume there is only one such cookie
|
||||
foreach ($cookies as $key => $cookie);
|
||||
foreach ($cookies as $cookie);
|
||||
{
|
||||
if (substr($key, -4) == '_sid')
|
||||
if (substr($cookie->getName(), -4) == '_sid')
|
||||
{
|
||||
$this->sid = $cookie->getValue();
|
||||
}
|
||||
|
Reference in New Issue
Block a user