aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2012-07-19 16:40:33 +0200
committerAndreas Fischer <bantu@phpbb.com>2012-07-19 16:40:33 +0200
commit3bbb882fe8b9c894e9ad6cf9b4c42b590b8b3fe2 (patch)
tree427377489c148b339fc179f9461b9f19ec23199c
parenteeef82ecc585caab1298f3559ccb8f615a89e706 (diff)
parentaa2f7bcc2c56fdd82cb07e9794d6114d4b2c359c (diff)
downloadforums-3bbb882fe8b9c894e9ad6cf9b4c42b590b8b3fe2.tar
forums-3bbb882fe8b9c894e9ad6cf9b4c42b590b8b3fe2.tar.gz
forums-3bbb882fe8b9c894e9ad6cf9b4c42b590b8b3fe2.tar.bz2
forums-3bbb882fe8b9c894e9ad6cf9b4c42b590b8b3fe2.tar.xz
forums-3bbb882fe8b9c894e9ad6cf9b4c42b590b8b3fe2.zip
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
-rw-r--r--.travis.yml3
-rwxr-xr-xcomposer.pharbin0 -> 533673 bytes
-rw-r--r--phpBB/composer.json6
-rw-r--r--phpBB/composer.lock55
-rw-r--r--tests/bootstrap.php15
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php19
-rw-r--r--vendor/goutte.pharbin267414 -> 0 bytes
7 files changed, 85 insertions, 13 deletions
diff --git a/.travis.yml b/.travis.yml
index 2dbc2fc6d8..42d7b201fa 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,6 +15,9 @@ before_script:
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear install --force phpunit/DbUnit; else pyrus install --force phpunit/DbUnit; fi"
- phpenv rehash
+ - cd phpBB
+ - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then php ../composer.phar install --dev; fi"
+ - cd ..
script:
- phpunit --configuration travis/phpunit-$DB-travis.xml
diff --git a/composer.phar b/composer.phar
new file mode 100755
index 0000000000..8b6eddbf21
--- /dev/null
+++ b/composer.phar
Binary files differ
diff --git a/phpBB/composer.json b/phpBB/composer.json
new file mode 100644
index 0000000000..c2811ad1d7
--- /dev/null
+++ b/phpBB/composer.json
@@ -0,0 +1,6 @@
+{
+ "minimum-stability": "beta",
+ "require-dev": {
+ "fabpot/goutte": "1.0.x-dev"
+ }
+}
diff --git a/phpBB/composer.lock b/phpBB/composer.lock
new file mode 100644
index 0000000000..9f2195e70a
--- /dev/null
+++ b/phpBB/composer.lock
@@ -0,0 +1,55 @@
+{
+ "hash": "a5d02c59e3a91c84c1a96aca0f1ae81a",
+ "packages": [
+
+ ],
+ "packages-dev": [
+ {
+ "package": "fabpot/goutte",
+ "version": "dev-master",
+ "alias-pretty-version": "1.0.x-dev",
+ "alias-version": "1.0.9999999.9999999-dev"
+ },
+ {
+ "package": "fabpot/goutte",
+ "version": "dev-master",
+ "source-reference": "c2ea8d9a6682d14482e57ede2371001b8a5238d2",
+ "commit-date": "1340264258"
+ },
+ {
+ "package": "guzzle/guzzle",
+ "version": "v2.6.6"
+ },
+ {
+ "package": "symfony/browser-kit",
+ "version": "v2.1.0-BETA3"
+ },
+ {
+ "package": "symfony/css-selector",
+ "version": "v2.1.0-BETA3"
+ },
+ {
+ "package": "symfony/dom-crawler",
+ "version": "v2.1.0-BETA3"
+ },
+ {
+ "package": "symfony/event-dispatcher",
+ "version": "v2.1.0-BETA3"
+ },
+ {
+ "package": "symfony/finder",
+ "version": "v2.1.0-BETA3"
+ },
+ {
+ "package": "symfony/process",
+ "version": "v2.1.0-BETA3"
+ }
+ ],
+ "aliases": [
+
+ ],
+ "minimum-stability": "beta",
+ "stability-flags": {
+ "fabpot/goutte": 20
+ }
+}
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index d6c5d25bc8..d687db622a 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -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';
}
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 76fed76fae..ed8ce9d040 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/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();
}
diff --git a/vendor/goutte.phar b/vendor/goutte.phar
deleted file mode 100644
index 20b7166a67..0000000000
--- a/vendor/goutte.phar
+++ /dev/null
Binary files differ