aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/build.xml1
-rw-r--r--phpBB/config/console.yml1
-rw-r--r--phpBB/includes/acp/acp_main.php2
-rw-r--r--phpBB/includes/acp/acp_styles.php1
-rw-r--r--phpBB/phpbb/console/command/cache/purge.php7
-rw-r--r--phpBB/phpbb/mimetype/guesser_interface.php1
-rw-r--r--phpunit.xml.all36
-rw-r--r--phpunit.xml.dist4
-rw-r--r--phpunit.xml.functional43
-rw-r--r--tests/RUNNING_TESTS.md14
10 files changed, 22 insertions, 88 deletions
diff --git a/build/build.xml b/build/build.xml
index 79b6096c97..9a04d4efdb 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -67,7 +67,6 @@
<exec dir="."
command="phpBB/vendor/bin/phpunit
--log-junit build/logs/phpunit.xml
- --configuration phpunit.xml.all
--group slow
--coverage-clover build/logs/clover-slow.xml
--coverage-html build/coverage-slow"
diff --git a/phpBB/config/console.yml b/phpBB/config/console.yml
index 1340d9c0d7..d32befa15e 100644
--- a/phpBB/config/console.yml
+++ b/phpBB/config/console.yml
@@ -7,6 +7,7 @@ services:
- @auth
- @log
- @user
+ - @config
tags:
- { name: console.command }
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index 9c1613e24a..74ea095496 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -349,7 +349,7 @@ class acp_main
break;
case 'purge_cache':
- global $cache;
+ $config->increment('assets_version', 1);
$cache->purge();
// Clear permissions
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 3f9d21f56c..7b277da9f9 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -146,6 +146,7 @@ class acp_styles
{
global $db, $cache, $auth;
+ $this->config->increment('assets_version', 1);
$this->cache->purge();
// Clear permissions
diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php
index 017bdc5144..013183cb35 100644
--- a/phpBB/phpbb/console/command/cache/purge.php
+++ b/phpBB/phpbb/console/command/cache/purge.php
@@ -28,13 +28,17 @@ class purge extends \phpbb\console\command\command
/** @var \phpbb\user */
protected $user;
- function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\user $user)
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ public function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\user $user, \phpbb\config\config $config)
{
$this->cache = $cache;
$this->db = $db;
$this->auth = $auth;
$this->log = $log;
$this->user = $user;
+ $this->config = $config;
$this->user->add_lang(array('acp/common'));
parent::__construct();
}
@@ -49,6 +53,7 @@ class purge extends \phpbb\console\command\command
protected function execute(InputInterface $input, OutputInterface $output)
{
+ $this->config->increment('assets_version', 1);
$this->cache->purge();
// Clear permissions
diff --git a/phpBB/phpbb/mimetype/guesser_interface.php b/phpBB/phpbb/mimetype/guesser_interface.php
index 103689765e..3cbcfeabe3 100644
--- a/phpBB/phpbb/mimetype/guesser_interface.php
+++ b/phpBB/phpbb/mimetype/guesser_interface.php
@@ -26,6 +26,7 @@ interface guesser_interface
* Guess mimetype of supplied file
*
* @param string $file Path to file
+ * @param string $file_name The real file name
*
* @return string Guess for mimetype of file
*/
diff --git a/phpunit.xml.all b/phpunit.xml.all
deleted file mode 100644
index 73d0536b9d..0000000000
--- a/phpunit.xml.all
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit backupGlobals="true"
- backupStaticAttributes="true"
- colors="true"
- convertErrorsToExceptions="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- processIsolation="false"
- stopOnFailure="false"
- syntaxCheck="false"
- bootstrap="tests/bootstrap.php"
->
- <testsuites>
- <testsuite name="phpBB Test Suite">
- <directory suffix="_test.php">./tests</directory>
- <exclude>./tests/lint_test.php</exclude>
- </testsuite>
- <testsuite name="phpBB Lint Test">
- <file>./tests/lint_test.php</file>
- </testsuite>
- </testsuites>
-
- <filter>
- <blacklist>
- <directory>./tests</directory>
- </blacklist>
- <whitelist>
- <directory suffix=".php">./phpBB/includes/</directory>
- <directory suffix=".php">./phpBB/phpbb/</directory>
- <exclude>
- <directory suffix=".php">./phpBB/includes/captcha/</directory>
- </exclude>
- </whitelist>
- </filter>
-</phpunit>
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index dd039fb567..3475742288 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -17,6 +17,9 @@
<exclude>./tests/functional</exclude>
<exclude>./tests/lint_test.php</exclude>
</testsuite>
+ <testsuite name="phpBB Functional Tests">
+ <directory suffix="_test.php">./tests/functional</directory>
+ </testsuite>
<testsuite name="phpBB Lint Test">
<file>./tests/lint_test.php</file>
</testsuite>
@@ -24,7 +27,6 @@
<groups>
<exclude>
- <group>functional</group>
<group>slow</group>
</exclude>
</groups>
diff --git a/phpunit.xml.functional b/phpunit.xml.functional
deleted file mode 100644
index ead8f4af68..0000000000
--- a/phpunit.xml.functional
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit backupGlobals="true"
- backupStaticAttributes="true"
- colors="true"
- convertErrorsToExceptions="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- processIsolation="false"
- stopOnFailure="false"
- syntaxCheck="false"
- bootstrap="tests/bootstrap.php"
->
- <testsuites>
- <testsuite name="phpBB Test Suite">
- <directory suffix="_test.php">./tests</directory>
- <exclude>./tests/functional</exclude>
- <exclude>./tests/lint_test.php</exclude>
- </testsuite>
- <testsuite name="phpBB Lint Test">
- <file>./tests/lint_test.php</file>
- </testsuite>
- </testsuites>
-
- <groups>
- <include>
- <group>functional</group>
- </include>
- </groups>
-
- <filter>
- <blacklist>
- <directory>./tests</directory>
- </blacklist>
- <whitelist>
- <directory suffix=".php">./phpBB/includes/</directory>
- <directory suffix=".php">./phpBB/phpbb/</directory>
- <exclude>
- <directory suffix=".php">./phpBB/includes/captcha/</directory>
- </exclude>
- </whitelist>
- </filter>
-</phpunit>
diff --git a/tests/RUNNING_TESTS.md b/tests/RUNNING_TESTS.md
index 0778046141..d638c86859 100644
--- a/tests/RUNNING_TESTS.md
+++ b/tests/RUNNING_TESTS.md
@@ -128,12 +128,16 @@ Slow tests
--------------
Certain tests, such as the UTF-8 normalizer or the DNS tests tend to be slow.
-Thus these tests are in the `slow` group, which is excluded by default. You can
-enable slow tests by copying the phpunit.xml.all file to phpunit.xml. If you
+Thus these tests are in the `slow` group, which is excluded by default. If you
only want the slow tests, run:
$ phpBB/vendor/bin/phpunit --group slow
+If you want all tests, run:
+
+ $ phpBB/vendor/bin/phpunit --group __nogroup__,functional,slow
+
+
Functional tests
-----------------
@@ -154,10 +158,10 @@ on which to run tests.
$phpbb_functional_url = 'http://localhost/phpBB3/';
-To then run the tests, you run PHPUnit, but use the phpunit.xml.functional
-config file instead of the default one. Specify this through the "-c" option:
+Functional tests are automatically run, if '$phpbb_functional_url' is configured.
+If you only want the functional tests, run:
- $ phpBB/vendor/bin/phpunit -c phpunit.xml.functional
+ $ phpBB/vendor/bin/phpunit --group functional
This will change your board's config.php file, but it makes a backup at
config_dev.php, so you can restore it after the test run is complete.