aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/adm/style/admin.css13
-rw-r--r--phpBB/assets/javascript/installer.js22
-rw-r--r--phpBB/composer.json3
-rw-r--r--phpBB/composer.lock238
-rw-r--r--phpBB/docs/events.md14
-rw-r--r--phpBB/includes/acp/acp_users.php8
-rw-r--r--phpBB/phpbb/cache/driver/base.php1
-rw-r--r--phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php5
-rw-r--r--phpBB/phpbb/di/container_builder.php31
-rw-r--r--phpBB/phpbb/language/language.php26
-rw-r--r--phpBB/styles/prosilver/template/navbar_header.html2
-rw-r--r--tests/functional/plupload_test.php12
-rw-r--r--tests/language/language_test.php19
-rw-r--r--tests/mock/phpbb_di_container_builder.php10
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php10
15 files changed, 363 insertions, 51 deletions
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index e38e1cc3d7..4bb9922d56 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -2554,6 +2554,7 @@ fieldset.permissions .padding {
#progress-bar {
position: relative;
width: 90%;
+ text-align: center;
height: 25px;
margin: 20px auto;
border: 1px solid #cecece;
@@ -2563,10 +2564,7 @@ fieldset.permissions .padding {
position: absolute;
top: 0;
width: 100%;
- text-align: center;
- line-height: 25px;
- font-weight: bold;
- color: #fff;
+ color: #000;
}
#progress-bar #progress-bar-filler {
@@ -2577,4 +2575,11 @@ fieldset.permissions .padding {
background-color: #3c84ad;
width: 0;
height: 25px;
+ overflow: hidden;
+ color: #fff;
+}
+
+#progress-bar p {
+ line-height: 25px;
+ font-weight: bold;
}
diff --git a/phpBB/assets/javascript/installer.js b/phpBB/assets/javascript/installer.js
index c5909556c6..5f2c65c776 100644
--- a/phpBB/assets/javascript/installer.js
+++ b/phpBB/assets/javascript/installer.js
@@ -177,7 +177,7 @@
* @param progressObject
*/
function setProgress(progressObject) {
- var $statusText, $progressBar, $progressText, $progressFiller;
+ var $statusText, $progressBar, $progressText, $progressFiller, $progressFillerText;
if (progressObject.task_name.length) {
if (!progressBarTriggered) {
@@ -189,18 +189,23 @@
$progressBar.attr('id', 'progress-bar');
$progressText = $('<p />');
$progressText.attr('id', 'progress-bar-text');
- $progressFiller = $('<span />');
+ $progressFiller = $('<div />');
$progressFiller.attr('id', 'progress-bar-filler');
- $progressFiller.html($progressText);
+ $progressFillerText = $('<p />');
+ $progressFillerText.attr('id', 'progress-bar-filler-text');
$statusText = $('<p />');
$statusText.attr('id', 'progress-status-text');
+ $progressFiller.append($progressFillerText);
+ $progressBar.append($progressText);
$progressBar.append($progressFiller);
$progressBarWrapper.append($statusText);
$progressBarWrapper.append($progressBar);
+ $progressFillerText.css('width', $progressBar.width());
+
progressBarTriggered = true;
} else if (progressObject.hasOwnProperty('restart')) {
clearInterval(progressTimer);
@@ -210,6 +215,7 @@
$statusText = $('#progress-status-text');
$progressText.text('0%');
+ $progressFillerText.text('0%');
$progressFiller.css('width', '0%');
currentProgress = 0;
@@ -342,15 +348,20 @@
*
* @param $progressText
* @param $progressFiller
+ * @param $progressFillerText
* @param progressLimit
*/
- function incrementFiller($progressText, $progressFiller, progressLimit) {
+ function incrementFiller($progressText, $progressFiller, $progressFillerText, progressLimit) {
if (currentProgress >= progressLimit || currentProgress >= 100) {
clearInterval(progressTimer);
return;
}
+ var $progressBar = $('#progress-bar');
+
currentProgress++;
+ $progressFillerText.css('width', $progressBar.width());
+ $progressFillerText.text(currentProgress + '%');
$progressText.text(currentProgress + '%');
$progressFiller.css('width', currentProgress + '%');
}
@@ -362,13 +373,14 @@
*/
function incrementProgressBar(progressLimit) {
var $progressFiller = $('#progress-bar-filler');
+ var $progressFillerText = $('#progress-bar-filler-text');
var $progressText = $('#progress-bar-text');
var progressStart = $progressFiller.width() / $progressFiller.offsetParent().width() * 100;
currentProgress = Math.floor(progressStart);
clearInterval(progressTimer);
progressTimer = setInterval(function() {
- incrementFiller($progressText, $progressFiller, progressLimit);
+ incrementFiller($progressText, $progressFiller, $progressFillerText, progressLimit);
}, 10);
}
diff --git a/phpBB/composer.json b/phpBB/composer.json
index 1b2625c593..89bbce4588 100644
--- a/phpBB/composer.json
+++ b/phpBB/composer.json
@@ -47,8 +47,7 @@
"twig/twig": "1.*"
},
"require-dev": {
- "fabpot/goutte": "1.0.*",
- "guzzle/guzzle": "3.9.*",
+ "fabpot/goutte": "~2.0",
"phing/phing": "2.4.*",
"phpunit/dbunit": "1.3.*",
"phpunit/phpunit": "4.1.*",
diff --git a/phpBB/composer.lock b/phpBB/composer.lock
index 079a64c704..6412029b0b 100644
--- a/phpBB/composer.lock
+++ b/phpBB/composer.lock
@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "b7cd29af73c4846ea28c2c9fbee1067b",
- "content-hash": "321f60039c3712a7e8b351aee8f9aca1",
+ "hash": "f76b5185058599cad6a87ef7c8c35fbf",
+ "content-hash": "b89d3c18f8d9b3c4dc476f92030a83a1",
"packages": [
{
"name": "bantu/ini-get-wrapper",
@@ -1356,41 +1356,34 @@
"packages-dev": [
{
"name": "fabpot/goutte",
- "version": "v1.0.7",
+ "version": "v2.0.4",
"source": {
"type": "git",
"url": "https://github.com/FriendsOfPHP/Goutte.git",
- "reference": "794b196e76bdd37b5155cdecbad311f0a3b07625"
+ "reference": "0ad3ee6dc2d0aaa832a80041a1e09bf394e99802"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/794b196e76bdd37b5155cdecbad311f0a3b07625",
- "reference": "794b196e76bdd37b5155cdecbad311f0a3b07625",
+ "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/0ad3ee6dc2d0aaa832a80041a1e09bf394e99802",
+ "reference": "0ad3ee6dc2d0aaa832a80041a1e09bf394e99802",
"shasum": ""
},
"require": {
- "ext-curl": "*",
- "guzzle/http": "~3.1",
- "php": ">=5.3.0",
+ "guzzlehttp/guzzle": ">=4,<6",
+ "php": ">=5.4.0",
"symfony/browser-kit": "~2.1",
"symfony/css-selector": "~2.1",
- "symfony/dom-crawler": "~2.1",
- "symfony/finder": "~2.1",
- "symfony/process": "~2.1"
- },
- "require-dev": {
- "guzzle/plugin-history": "~3.1",
- "guzzle/plugin-mock": "~3.1"
+ "symfony/dom-crawler": "~2.1"
},
"type": "application",
"extra": {
"branch-alias": {
- "dev-master": "1.0-dev"
+ "dev-master": "2.0-dev"
}
},
"autoload": {
- "psr-0": {
- "Goutte": "."
+ "psr-4": {
+ "Goutte\\": "Goutte"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1404,11 +1397,11 @@
}
],
"description": "A simple PHP Web Scraper",
- "homepage": "https://github.com/fabpot/Goutte",
+ "homepage": "https://github.com/FriendsOfPHP/Goutte",
"keywords": [
"scraper"
],
- "time": "2014-10-09 15:52:51"
+ "time": "2015-05-05 21:14:57"
},
{
"name": "guzzle/guzzle",
@@ -1506,6 +1499,165 @@
"time": "2015-03-18 18:23:50"
},
{
+ "name": "guzzlehttp/guzzle",
+ "version": "5.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/guzzle.git",
+ "reference": "f3c8c22471cb55475105c14769644a49c3262b93"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f3c8c22471cb55475105c14769644a49c3262b93",
+ "reference": "f3c8c22471cb55475105c14769644a49c3262b93",
+ "shasum": ""
+ },
+ "require": {
+ "guzzlehttp/ringphp": "^1.1",
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "ext-curl": "*",
+ "phpunit/phpunit": "^4.0",
+ "psr/log": "^1.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients",
+ "homepage": "http://guzzlephp.org/",
+ "keywords": [
+ "client",
+ "curl",
+ "framework",
+ "http",
+ "http client",
+ "rest",
+ "web service"
+ ],
+ "time": "2015-05-20 03:47:55"
+ },
+ {
+ "name": "guzzlehttp/ringphp",
+ "version": "1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/RingPHP.git",
+ "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/dbbb91d7f6c191e5e405e900e3102ac7f261bc0b",
+ "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b",
+ "shasum": ""
+ },
+ "require": {
+ "guzzlehttp/streams": "~3.0",
+ "php": ">=5.4.0",
+ "react/promise": "~2.0"
+ },
+ "require-dev": {
+ "ext-curl": "*",
+ "phpunit/phpunit": "~4.0"
+ },
+ "suggest": {
+ "ext-curl": "Guzzle will use specific adapters if cURL is present"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\Ring\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.",
+ "time": "2015-05-20 03:37:09"
+ },
+ {
+ "name": "guzzlehttp/streams",
+ "version": "3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/streams.git",
+ "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5",
+ "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\Stream\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "description": "Provides a simple abstraction over streams of data",
+ "homepage": "http://guzzlephp.org/",
+ "keywords": [
+ "Guzzle",
+ "stream"
+ ],
+ "time": "2014-10-12 19:18:40"
+ },
+ {
"name": "michelf/php-markdown",
"version": "1.6.0",
"source": {
@@ -2130,6 +2282,50 @@
"time": "2013-03-08 08:21:40"
},
{
+ "name": "react/promise",
+ "version": "v2.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/reactphp/promise.git",
+ "reference": "3b6fca09c7d56321057fa8867c8dbe1abf648627"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/reactphp/promise/zipball/3b6fca09c7d56321057fa8867c8dbe1abf648627",
+ "reference": "3b6fca09c7d56321057fa8867c8dbe1abf648627",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "React\\Promise\\": "src/"
+ },
+ "files": [
+ "src/functions_include.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jan Sorgalla",
+ "email": "jsorgalla@gmail.com"
+ }
+ ],
+ "description": "A lightweight implementation of CommonJS Promises/A for PHP",
+ "time": "2015-07-03 13:48:55"
+ },
+ {
"name": "sami/sami",
"version": "v1.4.1",
"source": {
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md
index f1dee8cee8..bb1289b74f 100644
--- a/phpBB/docs/events.md
+++ b/phpBB/docs/events.md
@@ -1028,6 +1028,20 @@ navbar_header_quick_links_before
* Since: 3.1.0-RC2
* Purpose: Add links to the top of the quick-links drop-down menu in the header
+navbar_header_user_profile_append
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.8-RC1
+* Purpose: Add links to the right of the user drop down area
+
+navbar_header_user_profile_prepend
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.8-RC1
+* Purpose: Add links to the left of the notification area
+
navbar_header_username_append
===
* Locations:
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 2bec4385c3..0ee6452ada 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1929,8 +1929,12 @@ class acp_users
}
}
- // Replace "error" strings with their real, localised form
- $error = $phpbb_avatar_manager->localize_errors($user, $error);
+ // Avatar manager is not initialized if avatars are disabled
+ if (isset($phpbb_avatar_manager))
+ {
+ // Replace "error" strings with their real, localised form
+ $error = $phpbb_avatar_manager->localize_errors($user, $error);
+ }
$avatar = phpbb_get_user_avatar($user_row, 'USER_AVATAR', true);
diff --git a/phpBB/phpbb/cache/driver/base.php b/phpBB/phpbb/cache/driver/base.php
index 55cd4668de..85762c4d95 100644
--- a/phpBB/phpbb/cache/driver/base.php
+++ b/phpBB/phpbb/cache/driver/base.php
@@ -49,6 +49,7 @@ abstract class base implements \phpbb\cache\driver\driver_interface
$this->remove_dir($fileInfo->getPathname());
}
else if (strpos($filename, 'container_') === 0 ||
+ strpos($filename, 'autoload_') === 0 ||
strpos($filename, 'url_matcher') === 0 ||
strpos($filename, 'url_generator') === 0 ||
strpos($filename, 'sql_') === 0 ||
diff --git a/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php
index ecee09ce77..65e5b3fa73 100644
--- a/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php
+++ b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php
@@ -17,7 +17,10 @@ class default_data_type_ids extends \phpbb\db\migration\migration
{
static public function depends_on()
{
- return array('\phpbb\db\migration\data\v320\v320a2');
+ return array(
+ '\phpbb\db\migration\data\v320\v320a2',
+ '\phpbb\db\migration\data\v320\oauth_states',
+ );
}
public function update_schema()
diff --git a/phpBB/phpbb/di/container_builder.php b/phpBB/phpbb/di/container_builder.php
index 433847b285..9583da14f5 100644
--- a/phpBB/phpbb/di/container_builder.php
+++ b/phpBB/phpbb/di/container_builder.php
@@ -135,6 +135,11 @@ class container_builder
$config_cache = new ConfigCache($container_filename, defined('DEBUG'));
if ($this->use_cache && $config_cache->isFresh())
{
+ if ($this->use_extensions)
+ {
+ require($this->get_autoload_filename());
+ }
+
require($config_cache->getPath());
$this->container = new \phpbb_cache_container();
}
@@ -405,6 +410,15 @@ class container_builder
$extensions = $ext_container->get('ext.manager')->all_enabled();
// Load each extension found
+ $autoloaders = '<?php
+/**
+ * Loads all extensions custom auto-loaders.
+ *
+ * This file has been auto-generated
+ * by phpBB while loading the extensions.
+ */
+
+';
foreach ($extensions as $ext_name => $path)
{
$extension_class = '\\' . str_replace('/', '\\', $ext_name) . '\\di\\extension';
@@ -420,9 +434,14 @@ class container_builder
$filename = $path . 'vendor/autoload.php';
if (file_exists($filename))
{
- require $filename;
+ $autoloaders .= "require('{$filename}');\n";
}
}
+
+ $configCache = new ConfigCache($this->get_autoload_filename(), false);
+ $configCache->write($autoloaders);
+
+ require($this->get_autoload_filename());
}
else
{
@@ -540,6 +559,16 @@ class container_builder
}
/**
+ * Get the filename under which the dumped extensions autoloader will be stored.
+ *
+ * @return string Path for dumped extensions autoloader
+ */
+ protected function get_autoload_filename()
+ {
+ return $this->get_cache_dir() . 'autoload_' . md5($this->phpbb_root_path) . '.' . $this->php_ext;
+ }
+
+ /**
* Return the name of the current environment.
*
* @return string
diff --git a/phpBB/phpbb/language/language.php b/phpBB/phpbb/language/language.php
index 382d4db89e..42429c2c07 100644
--- a/phpBB/phpbb/language/language.php
+++ b/phpBB/phpbb/language/language.php
@@ -246,14 +246,14 @@ class language
}
/**
- * Act like lang() but takes a key and an array of parameters instead of using variadic
+ * Returns the raw value associated to a language key or the language key no translation is available.
+ * No parameter substitution is performed, can be a string or an array.
*
* @param string|array $key Language key
- * @param array $args Parameters
*
* @return array|string
*/
- public function lang_array($key, $args = array())
+ public function lang_raw($key)
{
// Load common language files if they not loaded yet
if (!$this->common_language_files_loaded)
@@ -281,6 +281,26 @@ class language
return $key;
}
+ return $lang;
+ }
+
+ /**
+ * Act like lang() but takes a key and an array of parameters instead of using variadic
+ *
+ * @param string|array $key Language key
+ * @param array $args Parameters
+ *
+ * @return string
+ */
+ public function lang_array($key, $args = array())
+ {
+ $lang = $this->lang_raw($key);
+
+ if ($lang === $key)
+ {
+ return $key;
+ }
+
// If the language entry is a string, we simply mimic sprintf() behaviour
if (is_string($lang))
{
diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html
index a02ec45830..62f32344fb 100644
--- a/phpBB/styles/prosilver/template/navbar_header.html
+++ b/phpBB/styles/prosilver/template/navbar_header.html
@@ -100,6 +100,7 @@
<!-- ENDIF -->
<!-- IF S_REGISTERED_USER -->
+ <!-- EVENT navbar_header_user_profile_prepend -->
<li id="username_logged_in" class="rightside <!-- IF CURRENT_USER_AVATAR --> no-bulletin<!-- ENDIF -->" data-skip-responsive="true">
<!-- EVENT navbar_header_username_prepend -->
<div class="header-profile dropdown-container">
@@ -156,6 +157,7 @@
<!-- INCLUDE notification_dropdown.html -->
</li>
<!-- ENDIF -->
+ <!-- EVENT navbar_header_user_profile_append -->
<!-- ELSE -->
<li class="rightside" data-skip-responsive="true">
<a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x" role="menuitem">
diff --git a/tests/functional/plupload_test.php b/tests/functional/plupload_test.php
index d358681ad1..9d284a7e57 100644
--- a/tests/functional/plupload_test.php
+++ b/tests/functional/plupload_test.php
@@ -107,11 +107,11 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case
if ($i < self::CHUNKS - 1)
{
- $this->assertContains('{"jsonrpc":"2.0","id":"id","result":null}', self::$client->getResponse()->getContent());
+ $this->assertContains('{"jsonrpc":"2.0","id":"id","result":null}', self::get_content());
}
else
{
- $response = json_decode(self::$client->getResponse()->getContent(), true);
+ $response = json_decode(self::get_content(), true);
$this->assertEquals('valid.jpg', $response['data'][0]['real_filename']);
}
@@ -134,7 +134,8 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case
'error' => UPLOAD_ERR_OK,
);
- $crawler = self::$client->request(
+ self::$client->setServerParameter('HTTP_X_PHPBB_USING_PLUPLOAD', '1');
+ self::$client->request(
'POST',
$url . '&sid=' . $this->sid,
array(
@@ -144,11 +145,10 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case
'real_filename' => 'valid.jpg',
'add_file' => $this->lang('ADD_FILE'),
),
- array('fileupload' => $file),
- array('X-PHPBB-USING-PLUPLOAD' => '1')
+ array('fileupload' => $file)
);
- $response = json_decode(self::$client->getResponse()->getContent(), true);
+ $response = json_decode(self::get_content(), true);
$this->assertEquals('valid.jpg', $response['data'][0]['real_filename']);
}
}
diff --git a/tests/language/language_test.php b/tests/language/language_test.php
index 6a814e39dc..29b4873dcb 100644
--- a/tests/language/language_test.php
+++ b/tests/language/language_test.php
@@ -53,6 +53,25 @@ class phpbb_language_test extends phpbb_test_case
$this->assertFalse($this->lang->is_set(array('PHPBB', 'PHP')));
}
+ public function test_lang_raw()
+ {
+ $this->assertEquals($this->lang->lang_raw('FOO'), 'BAR');
+ $this->assertEquals($this->lang->lang_raw('VOID'), 'VOID');
+ $this->assertEquals($this->lang->lang_raw('ARRY'), array(
+ 0 => 'No posts', // 0
+ 1 => '1 post', // 1
+ 2 => '%d posts', // 2+
+ ));
+ }
+
+ public function test_lang_array()
+ {
+ $this->assertEquals($this->lang->lang_array('FOO'), 'BAR');
+ $this->assertEquals($this->lang->lang_array('VOID'), 'VOID');
+ $this->assertEquals($this->lang->lang_array('ARRY', [0]), 'No posts');
+ $this->assertEquals($this->lang->lang_array('FOO', [2, 3, 'BARZ']), 'BAR');
+ }
+
public function test_lang()
{
// No param
diff --git a/tests/mock/phpbb_di_container_builder.php b/tests/mock/phpbb_di_container_builder.php
index 59cdf0bb2b..23dc3d1e8b 100644
--- a/tests/mock/phpbb_di_container_builder.php
+++ b/tests/mock/phpbb_di_container_builder.php
@@ -17,4 +17,14 @@ class phpbb_mock_phpbb_di_container_builder extends \phpbb\di\container_builder
{
return $this->phpbb_root_path . '../../tmp/container.' . $this->php_ext;
}
+
+ /**
+ * Get the filename under which the dumped extensions autoloader will be stored.
+ *
+ * @return string Path for dumped extensions autoloader
+ */
+ protected function get_autoload_filename()
+ {
+ return $this->phpbb_root_path . '../../tmp/autoload.' . $this->php_ext;
+ }
}
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index a3864d3041..34fbcec0e2 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -16,6 +16,7 @@ require_once __DIR__ . '/mock/phpbb_mock_null_installer_task.php';
class phpbb_functional_test_case extends phpbb_test_case
{
+ /** @var \Goutte\Client */
static protected $client;
static protected $cookieJar;
static protected $root_url;
@@ -81,9 +82,6 @@ class phpbb_functional_test_case extends phpbb_test_case
self::$cookieJar = new CookieJar;
self::$client = new Goutte\Client(array(), null, self::$cookieJar);
- // Reset the curl handle because it is 0 at this point and not a valid
- // resource
- self::$client->getClient()->getCurlMulti()->reset(true);
// Clear the language array so that things
// that were added in other tests are gone
@@ -169,7 +167,7 @@ class phpbb_functional_test_case extends phpbb_test_case
*/
static public function get_content()
{
- return self::$client->getResponse()->getContent();
+ return (string) self::$client->getResponse()->getContent();
}
// bootstrap, called after board is set up
@@ -843,7 +841,7 @@ class phpbb_functional_test_case extends phpbb_test_case
static public function assert_response_html($status_code = 200)
{
// Any output before the doc type means there was an error
- $content = self::$client->getResponse()->getContent();
+ $content = self::get_content();
self::assertNotContains('[phpBB Debug]', $content);
self::assertStringStartsWith('<!DOCTYPE', trim($content), 'Output found before DOCTYPE specification.');
@@ -864,7 +862,7 @@ class phpbb_functional_test_case extends phpbb_test_case
static public function assert_response_xml($status_code = 200)
{
// Any output before the xml opening means there was an error
- $content = self::$client->getResponse()->getContent();
+ $content = self::get_content();
self::assertNotContains('[phpBB Debug]', $content);
self::assertStringStartsWith('<?xml', trim($content), 'Output found before XML specification.');