[ticket/17535] Convert config files, make data providers static

PHPBB-17535
This commit is contained in:
rxu 2025-07-16 17:36:45 +07:00
parent d7db296eab
commit 8a99024087
No known key found for this signature in database
GPG key ID: 8117904FEDEFDD17
199 changed files with 879 additions and 852 deletions

View file

@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="true" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupStaticAttributes="false" backupGlobals="true"
colors="true" colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false" processIsolation="false"
stopOnFailure="false" stopOnFailure="false"
verbose="true" bootstrap="../tests/bootstrap.php"
bootstrap="../tests/bootstrap.php"> xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<testsuites> <testsuites>
<testsuite name="phpBB Test Suite"> <testsuite name="phpBB Test Suite">
<directory suffix="_test.php">../tests</directory> <directory suffix="_test.php">../tests</directory>
@ -19,21 +18,19 @@
<directory suffix="_test.php">../tests/functional</directory> <directory suffix="_test.php">../tests/functional</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<groups> <groups>
<exclude> <exclude>
<group>slow</group> <group>slow</group>
</exclude> </exclude>
</groups> </groups>
<php> <php>
<server name="PHPBB_TEST_DBMS" value="mysqli" /> <server name="PHPBB_TEST_DBMS" value="mysqli"/>
<server name="PHPBB_TEST_DBHOST" value="0.0.0.0" /> <server name="PHPBB_TEST_DBHOST" value="0.0.0.0"/>
<server name="PHPBB_TEST_DBPORT" value="3306" /> <server name="PHPBB_TEST_DBPORT" value="3306"/>
<server name="PHPBB_TEST_DBNAME" value="phpbb_tests" /> <server name="PHPBB_TEST_DBNAME" value="phpbb_tests"/>
<server name="PHPBB_TEST_DBUSER" value="root" /> <server name="PHPBB_TEST_DBUSER" value="root"/>
<server name="PHPBB_TEST_DBPASSWD" value="" /> <server name="PHPBB_TEST_DBPASSWD" value=""/>
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/> <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
<server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" /> <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/"/>
</php> </php>
</phpunit> </phpunit>

View file

@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="true" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupStaticAttributes="false" backupGlobals="true"
colors="true" colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false" processIsolation="false"
stopOnFailure="false" stopOnFailure="false"
verbose="true" bootstrap="../tests/bootstrap.php"
bootstrap="../tests/bootstrap.php"> xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<testsuites> <testsuites>
<testsuite name="phpBB Test Suite"> <testsuite name="phpBB Test Suite">
<directory suffix="_test.php">../tests</directory> <directory suffix="_test.php">../tests</directory>
@ -19,23 +18,21 @@
<directory suffix="_test.php">../tests/functional</directory> <directory suffix="_test.php">../tests/functional</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<groups> <groups>
<exclude> <exclude>
<group>slow</group> <group>slow</group>
</exclude> </exclude>
</groups> </groups>
<php> <php>
<server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mssqlnative" /> <server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mssqlnative"/>
<server name="PHPBB_TEST_DBHOST" value="127.0.0.1" /> <server name="PHPBB_TEST_DBHOST" value="127.0.0.1"/>
<server name="PHPBB_TEST_DBPORT" value="" /> <server name="PHPBB_TEST_DBPORT" value=""/>
<server name="PHPBB_TEST_DBNAME" value="phpbb_tests" /> <server name="PHPBB_TEST_DBNAME" value="phpbb_tests"/>
<server name="PHPBB_TEST_DBUSER" value="sa" /> <server name="PHPBB_TEST_DBUSER" value="sa"/>
<server name="PHPBB_TEST_DBPASSWD" value="Pssw0rd_12" /> <server name="PHPBB_TEST_DBPASSWD" value="Pssw0rd_12"/>
<server name="PHPBB_TEST_REDIS_HOST" value="localhost" /> <server name="PHPBB_TEST_REDIS_HOST" value="localhost"/>
<server name="PHPBB_TEST_MEMCACHED_HOST" value="localhost" /> <server name="PHPBB_TEST_MEMCACHED_HOST" value="localhost"/>
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/> <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
<server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" /> <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/"/>
</php> </php>
</phpunit> </phpunit>

View file

@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="true" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupStaticAttributes="false" backupGlobals="true"
colors="true" colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false" processIsolation="false"
stopOnFailure="false" stopOnFailure="false"
verbose="true" bootstrap="../tests/bootstrap.php"
bootstrap="../tests/bootstrap.php"> xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<testsuites> <testsuites>
<testsuite name="phpBB Test Suite"> <testsuite name="phpBB Test Suite">
<directory suffix="_test.php">../tests</directory> <directory suffix="_test.php">../tests</directory>
@ -19,23 +18,21 @@
<directory suffix="_test.php">../tests/functional</directory> <directory suffix="_test.php">../tests/functional</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<groups> <groups>
<exclude> <exclude>
<group>slow</group> <group>slow</group>
</exclude> </exclude>
</groups> </groups>
<php> <php>
<server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mysqli" /> <server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\mysqli"/>
<server name="PHPBB_TEST_DBHOST" value="0.0.0.0" /> <server name="PHPBB_TEST_DBHOST" value="0.0.0.0"/>
<server name="PHPBB_TEST_DBPORT" value="3306" /> <server name="PHPBB_TEST_DBPORT" value="3306"/>
<server name="PHPBB_TEST_DBNAME" value="phpbb_tests" /> <server name="PHPBB_TEST_DBNAME" value="phpbb_tests"/>
<server name="PHPBB_TEST_DBUSER" value="root" /> <server name="PHPBB_TEST_DBUSER" value="root"/>
<server name="PHPBB_TEST_DBPASSWD" value="" /> <server name="PHPBB_TEST_DBPASSWD" value=""/>
<server name="PHPBB_TEST_REDIS_HOST" value="localhost" /> <server name="PHPBB_TEST_REDIS_HOST" value="localhost"/>
<server name="PHPBB_TEST_MEMCACHED_HOST" value="localhost" /> <server name="PHPBB_TEST_MEMCACHED_HOST" value="localhost"/>
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/> <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
<server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" /> <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/"/>
</php> </php>
</phpunit> </phpunit>

View file

@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="true" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupStaticAttributes="false" backupGlobals="true"
colors="true" colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false" processIsolation="false"
stopOnFailure="false" stopOnFailure="false"
verbose="true" bootstrap="../tests/bootstrap.php"
bootstrap="../tests/bootstrap.php"> xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<testsuites> <testsuites>
<testsuite name="phpBB Test Suite"> <testsuite name="phpBB Test Suite">
<directory suffix="_test.php">../tests</directory> <directory suffix="_test.php">../tests</directory>
@ -19,23 +18,21 @@
<directory suffix="_test.php">../tests/functional</directory> <directory suffix="_test.php">../tests/functional</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<groups> <groups>
<exclude> <exclude>
<group>slow</group> <group>slow</group>
</exclude> </exclude>
</groups> </groups>
<php> <php>
<server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\postgres"/> <server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\postgres"/>
<server name="PHPBB_TEST_DBHOST" value="localhost" /> <server name="PHPBB_TEST_DBHOST" value="localhost"/>
<server name="PHPBB_TEST_DBPORT" value="5432" /> <server name="PHPBB_TEST_DBPORT" value="5432"/>
<server name="PHPBB_TEST_DBNAME" value="phpbb_tests" /> <server name="PHPBB_TEST_DBNAME" value="phpbb_tests"/>
<server name="PHPBB_TEST_DBUSER" value="postgres" /> <server name="PHPBB_TEST_DBUSER" value="postgres"/>
<server name="PHPBB_TEST_DBPASSWD" value="postgres" /> <server name="PHPBB_TEST_DBPASSWD" value="postgres"/>
<server name="PHPBB_TEST_REDIS_HOST" value="localhost" /> <server name="PHPBB_TEST_REDIS_HOST" value="localhost"/>
<server name="PHPBB_TEST_MEMCACHED_HOST" value="localhost" /> <server name="PHPBB_TEST_MEMCACHED_HOST" value="localhost"/>
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/> <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
<server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" /> <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/"/>
</php> </php>
</phpunit> </phpunit>

View file

@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="true" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupStaticAttributes="false" backupGlobals="true"
colors="true" colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false" processIsolation="false"
stopOnFailure="false" stopOnFailure="false"
verbose="true" bootstrap="../tests/bootstrap.php"
bootstrap="../tests/bootstrap.php"> xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<testsuites> <testsuites>
<testsuite name="phpBB Test Suite"> <testsuite name="phpBB Test Suite">
<directory suffix="_test.php">../tests</directory> <directory suffix="_test.php">../tests</directory>
@ -19,23 +18,21 @@
<directory suffix="_test.php">../tests/functional</directory> <directory suffix="_test.php">../tests/functional</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<groups> <groups>
<exclude> <exclude>
<group>slow</group> <group>slow</group>
</exclude> </exclude>
</groups> </groups>
<php> <php>
<server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\postgres"/> <server name="PHPBB_TEST_DBMS" value="phpbb\db\driver\postgres"/>
<server name="PHPBB_TEST_DBHOST" value="localhost" /> <server name="PHPBB_TEST_DBHOST" value="localhost"/>
<server name="PHPBB_TEST_DBPORT" value="5432" /> <server name="PHPBB_TEST_DBPORT" value="5432"/>
<server name="PHPBB_TEST_DBNAME" value="phpbb_tests" /> <server name="PHPBB_TEST_DBNAME" value="phpbb_tests"/>
<server name="PHPBB_TEST_DBUSER" value="postgres" /> <server name="PHPBB_TEST_DBUSER" value="postgres"/>
<server name="PHPBB_TEST_DBPASSWD" value="root" /> <server name="PHPBB_TEST_DBPASSWD" value="root"/>
<server name="PHPBB_TEST_REDIS_HOST" value="localhost" /> <server name="PHPBB_TEST_REDIS_HOST" value="localhost"/>
<server name="PHPBB_TEST_MEMCACHED_HOST" value="localhost" /> <server name="PHPBB_TEST_MEMCACHED_HOST" value="localhost"/>
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/> <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
<server name="PHPBB_FUNCTIONAL_URL" value="http://phpbb.test/" /> <server name="PHPBB_FUNCTIONAL_URL" value="http://phpbb.test/"/>
</php> </php>
</phpunit> </phpunit>

View file

@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="true" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupStaticAttributes="false" backupGlobals="true"
colors="true" colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false" processIsolation="false"
stopOnFailure="false" stopOnFailure="false"
verbose="true" bootstrap="../tests/bootstrap.php"
bootstrap="../tests/bootstrap.php"> xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<testsuites> <testsuites>
<testsuite name="phpBB Test Suite"> <testsuite name="phpBB Test Suite">
<directory suffix="_test.php">../tests</directory> <directory suffix="_test.php">../tests</directory>
@ -19,17 +18,15 @@
<directory suffix="_test.php">../tests/functional</directory> <directory suffix="_test.php">../tests/functional</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<groups> <groups>
<exclude> <exclude>
<group>slow</group> <group>slow</group>
</exclude> </exclude>
</groups> </groups>
<php> <php>
<server name="PHPBB_TEST_REDIS_HOST" value="localhost" /> <server name="PHPBB_TEST_REDIS_HOST" value="0.0.0.0"/>
<server name="PHPBB_TEST_MEMCACHED_HOST" value="localhost" /> <server name="PHPBB_TEST_MEMCACHED_HOST" value="localhost"/>
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/> <server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
<server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" /> <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/"/>
</php> </php>
</phpunit> </phpunit>

View file

@ -249,7 +249,7 @@ jobs:
DB: ${{steps.database-type.outputs.db}} DB: ${{steps.database-type.outputs.db}}
if: ${{ matrix.SLOWTESTS != 1 && matrix.NOTESTS != 1 }} if: ${{ matrix.SLOWTESTS != 1 && matrix.NOTESTS != 1 }}
run: | run: |
phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --stop-on-error phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --display-all-issues --stop-on-error
- name: Slow tests - name: Slow tests
env: env:
@ -378,7 +378,7 @@ jobs:
env: env:
DB: ${{steps.database-type.outputs.db}} DB: ${{steps.database-type.outputs.db}}
run: | run: |
phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --stop-on-error phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --display-all-issues --stop-on-error
# Other database types, namely sqlite3 and mssql # Other database types, namely sqlite3 and mssql
other-tests: other-tests:
@ -606,8 +606,8 @@ jobs:
- name: Run unit tests - name: Run unit tests
if: ${{ matrix.type == 'unit' }} if: ${{ matrix.type == 'unit' }}
run: | run: |
phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --stop-on-error --exclude-group functional,slow phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --display-all-issues --stop-on-error --exclude-group functional,slow
- name: Run functional tests - name: Run functional tests
if: ${{ matrix.type == 'functional' }} if: ${{ matrix.type == 'functional' }}
run: | run: |
phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --stop-on-error --group functional phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --display-all-issues --stop-on-error --group functional

View file

@ -1,22 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
backupGlobals="true" backupGlobals="true"
backupStaticAttributes="false"
colors="true" colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false" processIsolation="false"
stopOnFailure="false" stopOnFailure="false"
bootstrap="tests/bootstrap.php" bootstrap="tests/bootstrap.php"
> cacheDirectory=".phpunit.cache"
<coverage> backupStaticProperties="false">
<include>
<directory suffix=".php">./phpBB/includes/</directory>
<directory suffix=".php">./phpBB/phpbb/</directory>
</include>
</coverage>
<testsuites> <testsuites>
<testsuite name="phpBB Test Suite"> <testsuite name="phpBB Test Suite">
<directory suffix="_test.php">./tests</directory> <directory suffix="_test.php">./tests</directory>
@ -35,4 +26,10 @@
<group>slow</group> <group>slow</group>
</exclude> </exclude>
</groups> </groups>
<source>
<include>
<directory suffix=".php">./phpBB/includes/</directory>
<directory suffix=".php">./phpBB/phpbb/</directory>
</include>
</source>
</phpunit> </phpunit>

View file

@ -53,7 +53,7 @@ class phpbb_attachment_delete_test extends \phpbb_database_test_case
$this->attachment_delete = new \phpbb\attachment\delete($this->config, $this->db, $this->dispatcher, $this->resync, $this->storage); $this->attachment_delete = new \phpbb\attachment\delete($this->config, $this->db, $this->dispatcher, $this->resync, $this->storage);
} }
public function data_attachment_delete() public static function data_attachment_delete()
{ {
return array( return array(
array('attach', '', false, false), array('attach', '', false, false),
@ -83,7 +83,7 @@ class phpbb_attachment_delete_test extends \phpbb_database_test_case
$this->assertSame($expected, $this->attachment_delete->delete($mode, $ids, $resync)); $this->assertSame($expected, $this->attachment_delete->delete($mode, $ids, $resync));
} }
public function data_attachment_unlink() public static function data_attachment_unlink()
{ {
return array( return array(
array(true, true), array(true, true),

View file

@ -38,7 +38,7 @@ class phpbb_attachment_manager_test extends \phpbb_test_case
return new \phpbb\attachment\manager($this->delete, $this->resync, $this->upload); return new \phpbb\attachment\manager($this->delete, $this->resync, $this->upload);
} }
public function data_manager() public static function data_manager()
{ {
return array( return array(
array( array(

View file

@ -32,7 +32,7 @@ class phpbb_attachment_resync_test extends \phpbb_database_test_case
$this->resync = new \phpbb\attachment\resync($this->db); $this->resync = new \phpbb\attachment\resync($this->db);
} }
public function data_resync() public static function data_resync()
{ {
return array( return array(
array('', array(1), 'post_id', POSTS_TABLE, array('post_attachment' => '1'), array('post_attachment' => '1')), array('', array(1), 'post_id', POSTS_TABLE, array('post_attachment' => '1'), array('post_attachment' => '1')),

View file

@ -165,7 +165,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case
); );
} }
public function data_upload() public static function data_upload()
{ {
return array( return array(
array('foobar', 1, false, array('foobar', 1, false,
@ -280,7 +280,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case
), $filedata); ), $filedata);
} }
public function data_image_upload() public static function data_image_upload()
{ {
return array( return array(
array(false, false, array(), array(false, false, array(),

View file

@ -89,7 +89,7 @@ class phpbb_avatar_driver_gravatar_test extends \phpbb_database_test_case
$this->template_data = array_merge($this->template_data, $data); $this->template_data = array_merge($this->template_data, $data);
} }
public function data_prepare_form(): array public static function data_prepare_form(): array
{ {
return [ return [
[ [

View file

@ -148,7 +148,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
$this->assertEquals('avatar.driver.foobar', $drivers['avatar.driver.foobar']); $this->assertEquals('avatar.driver.foobar', $drivers['avatar.driver.foobar']);
} }
public function get_driver_data_enabled() public static function get_driver_data_enabled()
{ {
return array( return array(
array('avatar.driver.foobar', 'avatar.driver.foobar'), array('avatar.driver.foobar', 'avatar.driver.foobar'),
@ -169,7 +169,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
$this->assertEquals($expected, ($driver === null) ? null : $driver->get_name()); $this->assertEquals($expected, ($driver === null) ? null : $driver->get_name());
} }
public function get_driver_data_all() public static function get_driver_data_all()
{ {
return array( return array(
array('avatar.driver.foobar', 'avatar.driver.foobar'), array('avatar.driver.foobar', 'avatar.driver.foobar'),
@ -205,7 +205,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
$this->assertEquals($expected_settings, $avatar_settings); $this->assertEquals($expected_settings, $avatar_settings);
} }
public function database_row_data() public static function database_row_data()
{ {
return array( return array(
array( array(
@ -327,7 +327,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
))); )));
} }
public function data_handle_avatar_delete() public static function data_handle_avatar_delete()
{ {
return array( return array(
array( array(

View file

@ -55,7 +55,7 @@ class ban_manager_test extends \phpbb_session_test_case
$this->phpbb_container = $phpbb_container; $this->phpbb_container = $phpbb_container;
} }
public function data_check_ban(): array public static function data_check_ban(): array
{ {
return [ return [
[ [
@ -170,7 +170,7 @@ class ban_manager_test extends \phpbb_session_test_case
$this->assertEquals($expected, $this->ban_manager->check($user_data)); $this->assertEquals($expected, $this->ban_manager->check($user_data));
} }
public function data_get_bans(): array public static function data_get_bans(): array
{ {
return [ return [
[ [
@ -298,7 +298,7 @@ class ban_manager_test extends \phpbb_session_test_case
$this->assertEquals($expected, $actual); $this->assertEquals($expected, $actual);
} }
public function data_get_ban_end(): array public static function data_get_ban_end(): array
{ {
return [ return [
[ [
@ -457,7 +457,7 @@ class ban_manager_test extends \phpbb_session_test_case
)); ));
} }
public function data_test_ban(): array public static function data_test_ban(): array
{ {
return [ return [
[ [
@ -629,7 +629,7 @@ class ban_manager_test extends \phpbb_session_test_case
); );
} }
public function data_test_unban(): array public static function data_test_unban(): array
{ {
return [ return [
[ [
@ -700,7 +700,7 @@ class ban_manager_test extends \phpbb_session_test_case
$this->assertFalse($check->invoke($ban_type_ip, [], [])); $this->assertFalse($check->invoke($ban_type_ip, [], []));
} }
public function data_get_ban_message(): array public static function data_get_ban_message(): array
{ {
return [ return [
[ [

View file

@ -16,7 +16,7 @@ require_once __DIR__ . '/../../phpBB/includes/message_parser.php';
class phpbb_bbcode_parser_test extends \phpbb_test_case class phpbb_bbcode_parser_test extends \phpbb_test_case
{ {
public function bbcode_firstpass_data() public static function bbcode_firstpass_data()
{ {
return array( return array(
// Default bbcodes from in their simplest way // Default bbcodes from in their simplest way
@ -249,10 +249,18 @@ class phpbb_bbcode_parser_test extends \phpbb_test_case
$this->markTestIncomplete($incomplete); $this->markTestIncomplete($incomplete);
} }
global $user, $request, $symfony_request; global $user, $request, $symfony_request, $phpbb_dispatcher, $config, $phpEx, $request, $symfony_request;
$phpEx = 'php';
$config = new \phpbb\config\config([
'max_post_font_size' => 0,
'force_server_vars' => 0,
'server_name' => 'testhost',
]);
$user = new phpbb_mock_user; $user = new phpbb_mock_user;
$user->lang['UNAUTHORISED_BBCODE'] = 'UNAUTHORISED_BBCODE';
$request = new phpbb_mock_request; $request = new phpbb_mock_request;
$symfony_request = new \phpbb\symfony_request($request); $symfony_request = new \phpbb\symfony_request($request);
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$bbcode = new bbcode_firstpass(); $bbcode = new bbcode_firstpass();
$bbcode->mode = 'post'; $bbcode->mode = 'post';

View file

@ -16,7 +16,7 @@ require_once __DIR__ . '/../../phpBB/includes/message_parser.php';
class phpbb_url_bbcode_test extends phpbb_test_case class phpbb_url_bbcode_test extends phpbb_test_case
{ {
public function url_bbcode_test_data() public static function url_bbcode_test_data()
{ {
return array( return array(
array( array(
@ -52,10 +52,18 @@ class phpbb_url_bbcode_test extends phpbb_test_case
*/ */
public function test_url($description, $message, $expected) public function test_url($description, $message, $expected)
{ {
global $user, $request, $symfony_request; global $user, $request, $symfony_request, $phpbb_dispatcher, $config, $phpEx, $request, $symfony_request;
$phpEx = 'php';
$config = new \phpbb\config\config([
'max_post_font_size' => 0,
'force_server_vars' => 0,
'server_name' => 'testhost',
]);
$user = new phpbb_mock_user; $user = new phpbb_mock_user;
$user->lang['UNAUTHORISED_BBCODE'] = 'UNAUTHORISED_BBCODE';
$request = new phpbb_mock_request; $request = new phpbb_mock_request;
$symfony_request = new \phpbb\symfony_request($request); $symfony_request = new \phpbb\symfony_request($request);
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$bbcode = new bbcode_firstpass(); $bbcode = new bbcode_firstpass();
$bbcode->message = $message; $bbcode->message = $message;

View file

@ -32,7 +32,7 @@ class phpbb_cache_redis_driver_test extends \phpbb_cache_common_test_case
$config = phpbb_test_case_helpers::get_test_config(); $config = phpbb_test_case_helpers::get_test_config();
if (isset($config['redis_host']) || isset($config['redis_port'])) if (isset($config['redis_host']) || isset($config['redis_port']))
{ {
$host = isset($config['redis_host']) ? $config['redis_host'] : 'localhost'; $host = isset($config['redis_host']) ? $config['redis_host'] : '0.0.0.0';
$port = isset($config['redis_port']) ? $config['redis_port'] : 6379; $port = isset($config['redis_port']) ? $config['redis_port'] : 6379;
self::$config = array('host' => $host, 'port' => $port); self::$config = array('host' => $host, 'port' => $port);
} }
@ -46,12 +46,14 @@ class phpbb_cache_redis_driver_test extends \phpbb_cache_common_test_case
protected function setUp(): void protected function setUp(): void
{ {
global $phpbb_root_path, $phpbb_container; global $phpbb_root_path, $phpbb_container, $dbname, $table_prefix;
parent::setUp(); parent::setUp();
$phpbb_container = new phpbb_mock_container_builder(); $phpbb_container = new phpbb_mock_container_builder();
$phpbb_container->setParameter('core.cache_dir', $phpbb_root_path . 'cache/' . PHPBB_ENVIRONMENT . '/'); $phpbb_container->setParameter('core.cache_dir', $phpbb_root_path . 'cache/' . PHPBB_ENVIRONMENT . '/');
$config = phpbb_test_case_helpers::get_test_config();
$dbname = $config['dbname'];
$this->driver = new \phpbb\cache\driver\redis(self::$config['host'], self::$config['port']); $this->driver = new \phpbb\cache\driver\redis(self::$config['host'], self::$config['port']);
$this->driver->purge(); $this->driver->purge();
} }

View file

@ -51,7 +51,7 @@ class phpbb_captcha_qa_test extends \phpbb_database_test_case
$this->assertSame('foobar', $this->qa->get_service_name()); $this->assertSame('foobar', $this->qa->get_service_name());
} }
public function data_acp_get_question_input() public static function data_acp_get_question_input()
{ {
return array( return array(
array("foobar\ntest\nyes", array( array("foobar\ntest\nyes", array(

View file

@ -120,7 +120,7 @@ class phpbb_compress_test extends phpbb_test_case
} }
} }
public function tar_archive_list() public static function tar_archive_list()
{ {
return array( return array(
array('archive.tar', '.tar', array()), array('archive.tar', '.tar', array()),

View file

@ -50,7 +50,7 @@ class phpbb_console_user_activate_test extends phpbb_console_user_base
return new CommandTester($command); return new CommandTester($command);
} }
public function activate_test_data() public static function activate_test_data()
{ {
return array( return array(
// Test an inactive user // Test an inactive user

View file

@ -21,7 +21,7 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
return $this->createXMLDataSet(__DIR__ . '/fixtures/delete_post.xml'); return $this->createXMLDataSet(__DIR__ . '/fixtures/delete_post.xml');
} }
public function delete_post_data() public static function delete_post_data()
{ {
$info_data = array( $info_data = array(
'topic_first_post_id' => 1, 'topic_first_post_id' => 1,

View file

@ -18,7 +18,7 @@ class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_data
return $this->createXMLDataSet(__DIR__ . '/fixtures/get_forums_visibility_sql.xml'); return $this->createXMLDataSet(__DIR__ . '/fixtures/get_forums_visibility_sql.xml');
} }
public function get_forums_visibility_sql_data() public static function get_forums_visibility_sql_data()
{ {
return array( return array(
array( array(

View file

@ -18,7 +18,7 @@ class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_data
return $this->createXMLDataSet(__DIR__ . '/fixtures/get_forums_visibility_sql.xml'); return $this->createXMLDataSet(__DIR__ . '/fixtures/get_forums_visibility_sql.xml');
} }
public function get_global_visibility_sql_data() public static function get_global_visibility_sql_data()
{ {
return array( return array(
array( array(

View file

@ -18,7 +18,7 @@ class phpbb_content_visibility_get_visibility_sql_test extends phpbb_database_te
return $this->createXMLDataSet(__DIR__ . '/fixtures/get_visibility_sql.xml'); return $this->createXMLDataSet(__DIR__ . '/fixtures/get_visibility_sql.xml');
} }
public function get_visibility_sql_data() public static function get_visibility_sql_data()
{ {
return array( return array(
// data set 0: display_unapproved_posts=false, moderator, can see all posts // data set 0: display_unapproved_posts=false, moderator, can see all posts

View file

@ -21,7 +21,7 @@ class phpbb_content_visibility_set_post_visibility_test extends phpbb_database_t
return $this->createXMLDataSet(__DIR__ . '/fixtures/set_post_visibility.xml'); return $this->createXMLDataSet(__DIR__ . '/fixtures/set_post_visibility.xml');
} }
public function set_post_visibility_data() public static function set_post_visibility_data()
{ {
return array( return array(
array( array(
@ -155,7 +155,7 @@ class phpbb_content_visibility_set_post_visibility_test extends phpbb_database_t
} }
} }
public function set_post_soft_deleted_data() public static function set_post_soft_deleted_data()
{ {
return array( return array(
array( array(

View file

@ -21,7 +21,7 @@ class phpbb_content_visibility_set_topic_visibility_test extends phpbb_database_
return $this->createXMLDataSet(__DIR__ . '/fixtures/set_topic_visibility.xml'); return $this->createXMLDataSet(__DIR__ . '/fixtures/set_topic_visibility.xml');
} }
public function set_topic_visibility_data() public static function set_topic_visibility_data()
{ {
return array( return array(
array( array(

View file

@ -79,7 +79,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
return 'app.php'; return 'app.php';
} }
protected function path_to_app() protected static function path_to_app()
{ {
return ''; return '';
} }
@ -166,36 +166,36 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
$this->root_path = $this->get_phpbb_root_path(); $this->root_path = $this->get_phpbb_root_path();
} }
public function helper_url_data_no_rewrite() public static function helper_url_data_no_rewrite()
{ {
return array( return array(
array('controller2', array('t' => 1, 'f' => 2), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'), array('controller2', array('t' => 1, 'f' => 2), true, false, '/' . static::path_to_app() . 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
array('controller2', array('t' => 1, 'f' => 2), false, false, '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'), array('controller2', array('t' => 1, 'f' => 2), false, false, '/' . static::path_to_app() . 'app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
// Custom sid parameter // Custom sid parameter
array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '/' . static::path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '/' . static::path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
// Testing anchors // Testing anchors
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . static::path_to_app() . 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '/' . static::path_to_app() . 'app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
// Anchors and custom sid // Anchors and custom sid
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . static::path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '/' . static::path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
// Empty parameters should not append the &amp; or ? // Empty parameters should not append the &amp; or ?
array('controller2', array(), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'), array('controller2', array(), true, false, '/' . static::path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
array('controller2', array(), false, false, '/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'), array('controller2', array(), false, false, '/' . static::path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
array('controller3', array('p' => 3), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'), array('controller3', array('p' => 3), true, false, '/' . static::path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'),
// Resolves DI parameters // Resolves DI parameters
array('controller4', array(), true, false, '/' . $this->path_to_app() . 'app.php/foo/' . PHPBB_ENVIRONMENT, 'di parameter'), array('controller4', array(), true, false, '/' . static::path_to_app() . 'app.php/foo/' . PHPBB_ENVIRONMENT, 'di parameter'),
); );
} }
@ -229,36 +229,36 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id), $description); static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id), $description);
} }
public function helper_url_data_with_rewrite() public static function helper_url_data_with_rewrite()
{ {
return array( return array(
array('controller2', array('t' => 1, 'f' => 2), true, false, '/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'), array('controller2', array('t' => 1, 'f' => 2), true, false, '/' . static::path_to_app() . 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
array('controller2', array('t' => 1, 'f' => 2), false, false, '/' . $this->path_to_app() . 'foo/bar?t=1&f=2', 'parameters in params-argument as array'), array('controller2', array('t' => 1, 'f' => 2), false, false, '/' . static::path_to_app() . 'foo/bar?t=1&f=2', 'parameters in params-argument as array'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '/' . static::path_to_app() . 'foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '/' . static::path_to_app() . 'foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
// Custom sid parameter // Custom sid parameter
array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '/' . static::path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '/' . static::path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '/' . static::path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
// Testing anchors // Testing anchors
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . static::path_to_app() . 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '/' . $this->path_to_app() . 'foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '/' . static::path_to_app() . 'foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . static::path_to_app() . 'foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
// Anchors and custom sid // Anchors and custom sid
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . static::path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '/' . static::path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . static::path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
// Empty parameters should not append the &amp; or ? // Empty parameters should not append the &amp; or ?
array('controller2', array(), true, false, '/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'), array('controller2', array(), true, false, '/' . static::path_to_app() . 'foo/bar', 'no params using empty array'),
array('controller2', array(), false, false, '/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'), array('controller2', array(), false, false, '/' . static::path_to_app() . 'foo/bar', 'no params using empty array'),
array('controller3', array('p' => 3), true, false, '/' . $this->path_to_app() . 'foo/bar/p-3', 'no params using empty array'), array('controller3', array('p' => 3), true, false, '/' . static::path_to_app() . 'foo/bar/p-3', 'no params using empty array'),
// Resolves DI parameters // Resolves DI parameters
array('controller4', array(), true, false, '/' . $this->path_to_app() . 'foo/' . PHPBB_ENVIRONMENT, 'di parameter'), array('controller4', array(), true, false, '/' . static::path_to_app() . 'foo/' . PHPBB_ENVIRONMENT, 'di parameter'),
); );
} }
@ -292,36 +292,36 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id), $description); static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id), $description);
} }
public function helper_url_data_absolute() public static function helper_url_data_absolute()
{ {
return array( return array(
array('controller2', array('t' => 1, 'f' => 2), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'), array('controller2', array('t' => 1, 'f' => 2), true, false, 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
array('controller2', array('t' => 1, 'f' => 2), false, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'), array('controller2', array('t' => 1, 'f' => 2), false, false, 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
// Custom sid parameter // Custom sid parameter
array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
// Testing anchors // Testing anchors
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
// Anchors and custom sid // Anchors and custom sid
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
// Empty parameters should not append the &amp; or ? // Empty parameters should not append the &amp; or ?
array('controller2', array(), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'), array('controller2', array(), true, false, 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
array('controller2', array(), false, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'), array('controller2', array(), false, false, 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
array('controller3', array('p' => 3), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'), array('controller3', array('p' => 3), true, false, 'http://localhost/' . static::path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'),
// Resolves DI parameters // Resolves DI parameters
array('controller4', array(), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/' . PHPBB_ENVIRONMENT, 'di parameter'), array('controller4', array(), true, false, 'http://localhost/' . static::path_to_app() . 'app.php/foo/' . PHPBB_ENVIRONMENT, 'di parameter'),
); );
} }
@ -355,7 +355,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::ABSOLUTE_URL), $description); static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::ABSOLUTE_URL), $description);
} }
public function helper_url_data_relative_path() public static function helper_url_data_relative_path()
{ {
return array( return array(
array('controller2', array('t' => 1, 'f' => 2), true, false, 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'), array('controller2', array('t' => 1, 'f' => 2), true, false, 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
@ -418,36 +418,36 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::RELATIVE_PATH), $description); static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::RELATIVE_PATH), $description);
} }
public function helper_url_data_network() public static function helper_url_data_network()
{ {
return array( return array(
array('controller2', array('t' => 1, 'f' => 2), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'), array('controller2', array('t' => 1, 'f' => 2), true, false, '//localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
array('controller2', array('t' => 1, 'f' => 2), false, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'), array('controller2', array('t' => 1, 'f' => 2), false, false, '//localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '//localhost/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '//localhost/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
// Custom sid parameter // Custom sid parameter
array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '//localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
// Testing anchors // Testing anchors
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '//localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
// Anchors and custom sid // Anchors and custom sid
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '//localhost/' . static::path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . static::path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
// Empty parameters should not append the &amp; or ? // Empty parameters should not append the &amp; or ?
array('controller2', array(), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'), array('controller2', array(), true, false, '//localhost/' . static::path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
array('controller2', array(), false, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'), array('controller2', array(), false, false, '//localhost/' . static::path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
array('controller3', array('p' => 3), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'), array('controller3', array('p' => 3), true, false, '//localhost/' . static::path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'),
// Resolves DI parameters // Resolves DI parameters
array('controller4', array(), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/' . PHPBB_ENVIRONMENT, 'di parameter'), array('controller4', array(), true, false, '//localhost/' . static::path_to_app() . 'app.php/foo/' . PHPBB_ENVIRONMENT, 'di parameter'),
); );
} }
@ -481,36 +481,36 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::NETWORK_PATH), $description); static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::NETWORK_PATH), $description);
} }
public function helper_url_data_absolute_with_rewrite() public static function helper_url_data_absolute_with_rewrite()
{ {
return array( return array(
array('controller2', array('t' => 1, 'f' => 2), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'), array('controller2', array('t' => 1, 'f' => 2), true, false, 'http://localhost/' . static::path_to_app() . 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
array('controller2', array('t' => 1, 'f' => 2), false, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2', 'parameters in params-argument as array'), array('controller2', array('t' => 1, 'f' => 2), false, false, 'http://localhost/' . static::path_to_app() . 'foo/bar?t=1&f=2', 'parameters in params-argument as array'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, 'http://localhost/' . static::path_to_app() . 'foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, 'http://localhost/' . static::path_to_app() . 'foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
// Custom sid parameter // Custom sid parameter
array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . static::path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', 'http://localhost/' . static::path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . static::path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
// Testing anchors // Testing anchors
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . static::path_to_app() . 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, 'http://localhost/' . static::path_to_app() . 'foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . static::path_to_app() . 'foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
// Anchors and custom sid // Anchors and custom sid
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . static::path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', 'http://localhost/' . static::path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . static::path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
// Empty parameters should not append the &amp; or ? // Empty parameters should not append the &amp; or ?
array('controller2', array(), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'), array('controller2', array(), true, false, 'http://localhost/' . static::path_to_app() . 'foo/bar', 'no params using empty array'),
array('controller2', array(), false, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'), array('controller2', array(), false, false, 'http://localhost/' . static::path_to_app() . 'foo/bar', 'no params using empty array'),
array('controller3', array('p' => 3), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3', 'no params using empty array'), array('controller3', array('p' => 3), true, false, 'http://localhost/' . static::path_to_app() . 'foo/bar/p-3', 'no params using empty array'),
// Resolves DI parameters // Resolves DI parameters
array('controller4', array(), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/' . PHPBB_ENVIRONMENT, 'di parameter'), array('controller4', array(), true, false, 'http://localhost/' . static::path_to_app() . 'foo/' . PHPBB_ENVIRONMENT, 'di parameter'),
); );
} }
@ -544,7 +544,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::ABSOLUTE_URL), $description); static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::ABSOLUTE_URL), $description);
} }
public function helper_url_data_relative_path_with_rewrite() public static function helper_url_data_relative_path_with_rewrite()
{ {
return array( return array(
array('controller2', array('t' => 1, 'f' => 2), true, false, 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'), array('controller2', array('t' => 1, 'f' => 2), true, false, 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
@ -604,36 +604,36 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::RELATIVE_PATH), $description); static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::RELATIVE_PATH), $description);
} }
public function helper_url_data_network_with_rewrite() public static function helper_url_data_network_with_rewrite()
{ {
return array( return array(
array('controller2', array('t' => 1, 'f' => 2), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'), array('controller2', array('t' => 1, 'f' => 2), true, false, '//localhost/' . static::path_to_app() . 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
array('controller2', array('t' => 1, 'f' => 2), false, false, '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2', 'parameters in params-argument as array'), array('controller2', array('t' => 1, 'f' => 2), false, false, '//localhost/' . static::path_to_app() . 'foo/bar?t=1&f=2', 'parameters in params-argument as array'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '//localhost/' . static::path_to_app() . 'foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '//localhost/' . static::path_to_app() . 'foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
// Custom sid parameter // Custom sid parameter
array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . static::path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '//localhost/' . static::path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . static::path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
// Testing anchors // Testing anchors
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . static::path_to_app() . 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '//localhost/' . static::path_to_app() . 'foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . static::path_to_app() . 'foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
// Anchors and custom sid // Anchors and custom sid
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . static::path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '//localhost/' . static::path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . static::path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
// Empty parameters should not append the &amp; or ? // Empty parameters should not append the &amp; or ?
array('controller2', array(), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'), array('controller2', array(), true, false, '//localhost/' . static::path_to_app() . 'foo/bar', 'no params using empty array'),
array('controller2', array(), false, false, '//localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'), array('controller2', array(), false, false, '//localhost/' . static::path_to_app() . 'foo/bar', 'no params using empty array'),
array('controller3', array('p' => 3), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar/p-3', 'no params using empty array'), array('controller3', array('p' => 3), true, false, '//localhost/' . static::path_to_app() . 'foo/bar/p-3', 'no params using empty array'),
// Resolves DI parameters // Resolves DI parameters
array('controller4', array(), true, false, '//localhost/' . $this->path_to_app() . 'foo/' . PHPBB_ENVIRONMENT, 'di parameter'), array('controller4', array(), true, false, '//localhost/' . static::path_to_app() . 'foo/' . PHPBB_ENVIRONMENT, 'di parameter'),
); );
} }
@ -667,7 +667,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_database_test_
static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::NETWORK_PATH), $description); static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::NETWORK_PATH), $description);
} }
public function helper_url_data_force_server_vars() public static function helper_url_data_force_server_vars()
{ {
return array( return array(
array(false, true, 'my_server', 443, '/my/board', 'http://', UrlGeneratorInterface::ABSOLUTE_URL, 'http://my_server:443/my/board/app.php/foo'), array(false, true, 'my_server', 443, '/my/board', 'http://', UrlGeneratorInterface::ABSOLUTE_URL, 'http://my_server:443/my/board/app.php/foo'),

View file

@ -102,7 +102,7 @@ class phpbb_controller_controller_test extends phpbb_test_case
$this->assertEquals(array(), $resolver->getArguments($symfony_request, $resolver->getController($symfony_request))); $this->assertEquals(array(), $resolver->getArguments($symfony_request, $resolver->getController($symfony_request)));
} }
public function data_get_arguments() public static function data_get_arguments()
{ {
return array( return array(
array(array(new foo\controller(), 'handle2'), array('foo', 0)), array(array(new foo\controller(), 'handle2'), array('foo', 0)),

View file

@ -30,7 +30,7 @@ class phpbb_controller_helper_route_other_app_test extends phpbb_controller_comm
return 'app.php'; return 'app.php';
} }
protected function path_to_app() protected static function path_to_app()
{ {
return 'foo/'; return 'foo/';
} }

View file

@ -35,7 +35,7 @@ class phpbb_controller_helper_route_slash_test extends phpbb_controller_common_h
return 'app.php'; return 'app.php';
} }
protected function path_to_app() protected static function path_to_app()
{ {
return 'phpBB/'; return 'phpBB/';
} }

View file

@ -15,7 +15,7 @@ require_once __DIR__ . '/../mock/lang.php';
class phpbb_datetime_from_format_test extends phpbb_test_case class phpbb_datetime_from_format_test extends phpbb_test_case
{ {
public function from_format_data() public static function from_format_data()
{ {
return array( return array(
array( array(
@ -58,7 +58,7 @@ class phpbb_datetime_from_format_test extends phpbb_test_case
$this->assertEquals($expected, $user->format_date($timestamp, $format, true)); $this->assertEquals($expected, $user->format_date($timestamp, $format, true));
} }
public function relative_format_date_data() public static function relative_format_date_data()
{ {
// If the current time is too close to the testing time, // If the current time is too close to the testing time,
// the relative time will use "x minutes ago" instead of "today ..." // the relative time will use "x minutes ago" instead of "today ..."

View file

@ -51,7 +51,7 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
$this->tool = new \phpbb\db\migration\tool\module($this->db, $this->user, $module_manager, 'phpbb_modules'); $this->tool = new \phpbb\db\migration\tool\module($this->db, $this->user, $module_manager, 'phpbb_modules');
} }
public function exists_data_acp() public static function exists_data_acp()
{ {
return array( return array(
// Test the existing category // Test the existing category
@ -184,7 +184,7 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
$this->assertEquals($expected, $this->tool->exists('acp', $parent, $module, $lazy)); $this->assertEquals($expected, $this->tool->exists('acp', $parent, $module, $lazy));
} }
public function exists_data_ucp() public static function exists_data_ucp()
{ {
return array( return array(
// Test the existing category // Test the existing category

View file

@ -102,7 +102,7 @@ class phpbb_dbal_migrator_tool_permission_role_test extends phpbb_database_test_
$this->auth_admin = new \auth_admin(); $this->auth_admin = new \auth_admin();
} }
public function data_test_new_role_exists() public static function data_test_new_role_exists()
{ {
return [ return [
['ROLE_ADMIN_NEW', true], ['ROLE_ADMIN_NEW', true],
@ -119,7 +119,7 @@ class phpbb_dbal_migrator_tool_permission_role_test extends phpbb_database_test_
$this->assertEquals($expected, (bool) $this->tool->role_exists($role_name)); $this->assertEquals($expected, (bool) $this->tool->role_exists($role_name));
} }
public function data_test_permission_assign_new_roles() public static function data_test_permission_assign_new_roles()
{ {
return [ return [
[ [

View file

@ -45,7 +45,7 @@ class phpbb_dbal_migrator_tool_permission_test extends phpbb_database_test_case
$this->tool = new \phpbb\db\migration\tool\permission($this->db, $this->cache, $this->auth, $phpbb_root_path, $phpEx); $this->tool = new \phpbb\db\migration\tool\permission($this->db, $this->cache, $this->auth, $phpbb_root_path, $phpEx);
} }
public function exists_data() public static function exists_data()
{ {
return array( return array(
array( array(
@ -170,7 +170,7 @@ class phpbb_dbal_migrator_tool_permission_test extends phpbb_database_test_case
$this->assertFalse($this->tool->exists('global_test', true)); $this->assertFalse($this->tool->exists('global_test', true));
} }
public function data_test_permission_set() public static function data_test_permission_set()
{ {
return array( return array(
array( array(
@ -226,7 +226,7 @@ class phpbb_dbal_migrator_tool_permission_test extends phpbb_database_test_case
} }
} }
public function data_test_permission_role_exists() public static function data_test_permission_role_exists()
{ {
return array( return array(
array('ROLE_MOD_FULL', true), array('ROLE_MOD_FULL', true),

View file

@ -18,7 +18,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
return $this->createXMLDataSet(__DIR__.'/fixtures/three_users.xml'); return $this->createXMLDataSet(__DIR__.'/fixtures/three_users.xml');
} }
public function return_on_error_select_data() public static function return_on_error_select_data()
{ {
return array( return array(
array('phpbb_users', "username_clean = 'bertie'", array(array('username_clean' => 'bertie'))), array('phpbb_users', "username_clean = 'bertie'", array(array('username_clean' => 'bertie'))),
@ -45,7 +45,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $db->sql_fetchrowset($result)); $this->assertEquals($expected, $db->sql_fetchrowset($result));
} }
public function fetchrow_data() public static function fetchrow_data()
{ {
return array( return array(
array('', array(array('username_clean' => 'barfoo'), array('', array(array('username_clean' => 'barfoo'),
@ -96,7 +96,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }
public function fetchfield_data() public static function fetchfield_data()
{ {
return array( return array(
array('', array('barfoo', 'foobar', 'bertie')), array('', array('barfoo', 'foobar', 'bertie')),
@ -126,7 +126,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $ary); $this->assertEquals($expected, $ary);
} }
static public function fetchfield_seek_data() public static function fetchfield_seek_data()
{ {
return array( return array(
array(1, 'foobar'), array(1, 'foobar'),
@ -152,7 +152,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $field); $this->assertEquals($expected, $field);
} }
static public function query_limit_data() public static function query_limit_data()
{ {
return array( return array(
array(0, 0, array(array('username_clean' => 'barfoo'), array(0, 0, array(array('username_clean' => 'barfoo'),
@ -193,7 +193,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $ary); $this->assertEquals($expected, $ary);
} }
public function like_expression_data() public static function like_expression_data()
{ {
// * = any_char; # = one_char // * = any_char; # = one_char
return array( return array(
@ -230,7 +230,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }
public function not_like_expression_data() public static function not_like_expression_data()
{ {
// * = any_char; # = one_char // * = any_char; # = one_char
return array( return array(
@ -290,7 +290,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }
public function in_set_data() public static function in_set_data()
{ {
return array( return array(
array('user_id', 3, false, false, array(array('username_clean' => 'bertie'))), array('user_id', 3, false, false, array(array('username_clean' => 'bertie'))),
@ -364,7 +364,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }
public function build_array_data() public static function build_array_data()
{ {
return array( return array(
array(array('username_clean' => 'barfoo'), array(array('username_clean' => 'barfoo'))), array(array('username_clean' => 'barfoo'), array(array('username_clean' => 'barfoo'))),

View file

@ -18,7 +18,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
return $this->createXMLDataSet(__DIR__.'/fixtures/config.xml'); return $this->createXMLDataSet(__DIR__.'/fixtures/config.xml');
} }
public function build_array_insert_data() public static function build_array_insert_data()
{ {
return array( return array(
array(array( array(array(
@ -167,7 +167,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
$db->sql_freeresult($result); $db->sql_freeresult($result);
} }
public function update_data() public static function update_data()
{ {
return array( return array(
array( array(

View file

@ -146,7 +146,7 @@ class phpbb_email_parsing_test extends phpbb_test_case
$this->reflection_template_property->setAccessible(true); $this->reflection_template_property->setAccessible(true);
} }
public function email_parsing_data() public static function email_parsing_data()
{ {
return array( return array(
array('Author username', 'Any forum', 'The topic title', 'Dear user'), array('Author username', 'Any forum', 'The topic title', 'Dear user'),

View file

@ -13,7 +13,7 @@
class exception_listener_test extends phpbb_test_case class exception_listener_test extends phpbb_test_case
{ {
public function phpbb_exception_data() public static function phpbb_exception_data()
{ {
return array( return array(
array( array(

View file

@ -58,7 +58,7 @@ class phpbb_extension_extension_base_test extends phpbb_test_case
$container); $container);
} }
public function data_test_suffix_get_classes() public static function data_test_suffix_get_classes()
{ {
return array( return array(
array( array(

View file

@ -57,7 +57,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
); );
} }
public function set_extensions_data() public static function set_extensions_data()
{ {
return array( return array(
array( array(

View file

@ -163,7 +163,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals($metadata, $json); $this->assertEquals($metadata, $json);
} }
public function validator_non_existing_data() public static function validator_non_existing_data()
{ {
return array( return array(
array('name'), array('name'),
@ -223,7 +223,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
} }
} }
public function validator_invalid_data() public static function validator_invalid_data()
{ {
return array( return array(
array('name', 'asdf'), array('name', 'asdf'),
@ -281,7 +281,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
} }
} }
public function validator_requirements_data() public static function validator_requirements_data()
{ {
return array( return array(
array( array(

View file

@ -174,7 +174,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
), $acp_modules); ), $acp_modules);
} }
public function module_auth_test_data() public static function module_auth_test_data()
{ {
return array( return array(
// module_auth, expected result // module_auth, expected result

View file

@ -76,7 +76,7 @@ class phpbb_feed_attachments_base_test extends phpbb_database_test_case
); );
} }
public function data_fetch_attachments() public static function data_fetch_attachments()
{ {
return array( return array(
array(array(0), array(0)), array(array(0), array(0)),

View file

@ -54,7 +54,7 @@ class phpbb_files_types_base_test extends phpbb_test_case
$this->factory = new \phpbb\files\factory($this->container); $this->factory = new \phpbb\files\factory($this->container);
} }
public function data_check_upload_size() public static function data_check_upload_size()
{ {
return array( return array(
array('foo', '500KB', array()), array('foo', '500KB', array()),

View file

@ -71,7 +71,7 @@ class phpbb_files_types_form_test extends phpbb_test_case
$this->phpbb_root_path = $phpbb_root_path; $this->phpbb_root_path = $phpbb_root_path;
} }
public function data_upload_form() public static function data_upload_form()
{ {
return array( return array(
array( array(

View file

@ -96,7 +96,7 @@ class phpbb_files_types_local_test extends phpbb_test_case
$this->assertInstanceOf('\phpbb\files\filespec', $file); $this->assertInstanceOf('\phpbb\files\filespec', $file);
} }
public function data_upload_form() public static function data_upload_form()
{ {
return array( return array(
array( array(

View file

@ -96,7 +96,7 @@ class phpbb_files_upload_test extends phpbb_test_case
$this->assertFalse($upload->is_valid('foobar')); $this->assertFalse($upload->is_valid('foobar'));
} }
public function data_internal_error() public static function data_internal_error()
{ {
return array( return array(
array(UPLOAD_ERR_INI_SIZE, 'PHP_SIZE_OVERRUN'), array(UPLOAD_ERR_INI_SIZE, 'PHP_SIZE_OVERRUN'),

View file

@ -21,7 +21,7 @@ class phpbb_filesystem_clean_path_test extends phpbb_test_case
$this->filesystem = new \phpbb\filesystem\filesystem(); $this->filesystem = new \phpbb\filesystem\filesystem();
} }
public function clean_path_data() public static function clean_path_data()
{ {
return array( return array(
array('foo', 'foo'), array('foo', 'foo'),

View file

@ -21,7 +21,7 @@ class phpbb_filesystem_helper_clean_path_test extends phpbb_test_case
parent::setUp(); parent::setUp();
} }
public function clean_path_data() public static function clean_path_data()
{ {
yield ['foo', 'foo']; yield ['foo', 'foo'];
yield ['foo/bar', 'foo/bar']; yield ['foo/bar', 'foo/bar'];

View file

@ -21,7 +21,7 @@ class phpbb_filesystem_helper_is_absolute_test extends phpbb_test_case
parent::setUp(); parent::setUp();
} }
static public function is_absolute_data() public static function is_absolute_data()
{ {
// Empty // Empty
yield ['', false]; yield ['', false];

View file

@ -30,7 +30,7 @@ class phpbb_filesystem_helper_realpath_test extends phpbb_test_case
parent::setUp(); parent::setUp();
} }
public function realpath_resolve_absolute_without_symlinks_data() public static function realpath_resolve_absolute_without_symlinks_data()
{ {
// Constant data // Constant data
yield [__DIR__, __DIR__]; yield [__DIR__, __DIR__];
@ -42,7 +42,7 @@ class phpbb_filesystem_helper_realpath_test extends phpbb_test_case
yield [__FILE__ . '../', false]; yield [__FILE__ . '../', false];
} }
public function realpath_resolve_relative_without_symlinks_data() public static function realpath_resolve_relative_without_symlinks_data()
{ {
if (!function_exists('getcwd')) if (!function_exists('getcwd'))
{ {

View file

@ -23,7 +23,7 @@ class phpbb_filesystem_is_absolute_test extends phpbb_test_case
$this->filesystem = new \phpbb\filesystem\filesystem(); $this->filesystem = new \phpbb\filesystem\filesystem();
} }
static public function is_absolute_data() public static function is_absolute_data()
{ {
return array( return array(
// Empty // Empty

View file

@ -34,7 +34,7 @@ class phpbb_filesystem_realpath_test extends phpbb_test_case
$this->filesystem = new \phpbb\filesystem\filesystem(); $this->filesystem = new \phpbb\filesystem\filesystem();
} }
public function realpath_resolve_absolute_without_symlinks_data() public static function realpath_resolve_absolute_without_symlinks_data()
{ {
return array( return array(
// Constant data // Constant data
@ -49,7 +49,7 @@ class phpbb_filesystem_realpath_test extends phpbb_test_case
); );
} }
public function realpath_resolve_relative_without_symlinks_data() public static function realpath_resolve_relative_without_symlinks_data()
{ {
if (!function_exists('getcwd')) if (!function_exists('getcwd'))
{ {

View file

@ -65,7 +65,7 @@ class phpbb_functional_acp_bbcodes_test extends phpbb_functional_test_case
$this->assertStringContainsString($error, $text); $this->assertStringContainsString($error, $text);
} }
public function get_bbcode_error_tests() public static function get_bbcode_error_tests()
{ {
return [ return [
[ [

View file

@ -25,7 +25,7 @@ class phpbb_functional_acp_groups_test extends phpbb_functional_common_groups_te
return 'adm/index.php?i=groups&mode=manage&action=edit'; return 'adm/index.php?i=groups&mode=manage&action=edit';
} }
public function acp_group_test_data() public static function acp_group_test_data()
{ {
return array( return array(
'both_yes' => array( 'both_yes' => array(

View file

@ -48,7 +48,7 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
$this->assertStringContainsString($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text()); $this->assertStringContainsString($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text());
} }
public function permissions_data() public static function permissions_data()
{ {
return array( return array(
// description // description

View file

@ -25,7 +25,7 @@ class phpbb_functional_acp_profile_field_test extends phpbb_functional_test_case
$this->add_lang('acp/profile'); $this->add_lang('acp/profile');
} }
public function data_add_profile_field() public static function data_add_profile_field()
{ {
return array( return array(
array('profilefields.type.bool', array('profilefields.type.bool',

View file

@ -23,7 +23,7 @@ class phpbb_functional_avatar_acp_groups_test extends phpbb_functional_common_av
return 'adm/index.php?i=acp_groups&mode=manage&action=edit&g=5'; return 'adm/index.php?i=acp_groups&mode=manage&action=edit&g=5';
} }
public function avatar_acp_groups_data() public static function avatar_acp_groups_data()
{ {
return array( return array(
// Correct Gravatar // Correct Gravatar

View file

@ -23,7 +23,7 @@ class phpbb_functional_avatar_acp_users_test extends phpbb_functional_common_ava
return 'adm/index.php?i=acp_users&u=2&mode=avatar'; return 'adm/index.php?i=acp_users&u=2&mode=avatar';
} }
public function avatar_acp_users_data() public static function avatar_acp_users_data()
{ {
return array( return array(
// Gravatar with incorrect email // Gravatar with incorrect email

View file

@ -22,7 +22,7 @@ class phpbb_functional_avatar_ucp_groups_test extends phpbb_functional_common_av
return 'ucp.php?i=ucp_groups&mode=manage&action=edit&g=5'; return 'ucp.php?i=ucp_groups&mode=manage&action=edit&g=5';
} }
public function avatar_ucp_groups_data() public static function avatar_ucp_groups_data()
{ {
return array( return array(
// Gravatar with incorrect email // Gravatar with incorrect email

View file

@ -23,7 +23,7 @@ class phpbb_functional_avatar_ucp_users_test extends phpbb_functional_common_ava
return 'ucp.php?i=ucp_profile&mode=avatar'; return 'ucp.php?i=ucp_profile&mode=avatar';
} }
public function avatar_ucp_groups_data() public static function avatar_ucp_groups_data()
{ {
return array( return array(
// Gravatar with correct settings // Gravatar with correct settings

View file

@ -57,7 +57,7 @@ abstract class phpbb_functional_common_groups_test_case extends phpbb_functional
$this->assertStringContainsString($this->lang('CONFIG_UPDATED'), $crawler->text()); $this->assertStringContainsString($this->lang('CONFIG_UPDATED'), $crawler->text());
} }
public function groups_manage_test_data() public static function groups_manage_test_data()
{ {
return array( return array(
array('', 'GROUP_UPDATED'), array('', 'GROUP_UPDATED'),

View file

@ -255,6 +255,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case
$form = $crawler->selectButton('Submit')->form(); $form = $crawler->selectButton('Submit')->form();
$form['minimum_stability']->select('dev'); $form['minimum_stability']->select('dev');
$form['enable_packagist']->select('1');
$form['repositories'] = 'https://satis.phpbb.com/'; $form['repositories'] = 'https://satis.phpbb.com/';
$crawler = self::submit($form); $crawler = self::submit($form);
$this->assertContainsLang('CONFIG_UPDATED', $crawler->filter('div[class="successbox"] > p')->text()); $this->assertContainsLang('CONFIG_UPDATED', $crawler->filter('div[class="successbox"] > p')->text());

View file

@ -34,7 +34,7 @@ class phpbb_functional_forum_password_test extends phpbb_functional_test_case
$crawler = self::submit($form); $crawler = self::submit($form);
} }
public function data_enter_forum_with_password() public static function data_enter_forum_with_password()
{ {
return array( return array(
array('foowrong', 'WRONG_PASSWORD'), array('foowrong', 'WRONG_PASSWORD'),

View file

@ -72,7 +72,7 @@ class phpbb_functional_mcp_main_test extends phpbb_functional_test_case
return $post; return $post;
} }
public function mcp_view_forum_actions_data() public static function mcp_view_forum_actions_data()
{ {
// action, success message, require_confirmation // action, success message, require_confirmation
return [ return [
@ -181,7 +181,7 @@ class phpbb_functional_mcp_main_test extends phpbb_functional_test_case
$this->assertStringContainsString($this->lang('TOPICS_DELETED_SUCCESS'), $crawler->filter('#message p')->text()); $this->assertStringContainsString($this->lang('TOPICS_DELETED_SUCCESS'), $crawler->filter('#message p')->text());
} }
public function mcp_view_topic_actions_data() public static function mcp_view_topic_actions_data()
{ {
// action, success message, require_confirmation // action, success message, require_confirmation
return [ return [

View file

@ -16,7 +16,7 @@
*/ */
class functional_permission_roles_test extends phpbb_functional_test_case class functional_permission_roles_test extends phpbb_functional_test_case
{ {
public function data_permission_roles() public static function data_permission_roles()
{ {
return array( return array(
array( array(

View file

@ -60,7 +60,7 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case
} }
} }
public function get_urls() public static function get_urls()
{ {
return array( return array(
array('posting.php?mode=reply&t=1'), array('posting.php?mode=reply&t=1'),

View file

@ -301,7 +301,7 @@ class phpbb_functional_posting_test extends phpbb_functional_test_case
); );
} }
public function nonexistent_post_id_data() public static function nonexistent_post_id_data()
{ {
$nonexistent_post_id = 999999; // Random value $nonexistent_post_id = 999999; // Random value
return [ return [

View file

@ -102,7 +102,7 @@ class phpbb_functional_user_password_reset_test extends phpbb_functional_test_ca
$this->login(self::TEST_USER); $this->login(self::TEST_USER);
} }
public function data_reset_user_password() public static function data_reset_user_password()
{ {
return [ return [
['RESET_TOKEN_EXPIRED_OR_INVALID', 0, 'abcdef'], ['RESET_TOKEN_EXPIRED_OR_INVALID', 0, 'abcdef'],

View file

@ -15,13 +15,16 @@ class phpbb_build_url_test extends phpbb_test_case
{ {
protected function setUp(): void protected function setUp(): void
{ {
global $user, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path, $phpbb_path_helper; global $user, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path, $phpbb_path_helper, $config;
parent::setUp(); parent::setUp();
$phpbb_container = new phpbb_mock_container_builder(); $phpbb_container = new phpbb_mock_container_builder();
$user = new phpbb_mock_user(); $user = new phpbb_mock_user();
$phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$config = new \phpbb\config\config([
'enable_mod_rewrite' => 0,
]);
$phpbb_path_helper = new \phpbb\path_helper( $phpbb_path_helper = new \phpbb\path_helper(
new \phpbb\symfony_request( new \phpbb\symfony_request(
@ -33,7 +36,7 @@ class phpbb_build_url_test extends phpbb_test_case
); );
$phpbb_container->set('path_helper', $phpbb_path_helper); $phpbb_container->set('path_helper', $phpbb_path_helper);
} }
public function build_url_test_data() public static function build_url_test_data()
{ {
return array( return array(
array( array(
@ -79,8 +82,9 @@ class phpbb_build_url_test extends phpbb_test_case
*/ */
public function test_build_url($page, $strip_vars, $expected) public function test_build_url($page, $strip_vars, $expected)
{ {
global $user; global $config, $user, $phpbb_path_helper, $phpbb_dispatcher, $_SID;
$_SID = '';
$user->page['page'] = $page; $user->page['page'] = $page;
$output = build_url($strip_vars); $output = build_url($strip_vars);

View file

@ -13,7 +13,7 @@
class phpbb_convert_30_dbms_to_31_test extends phpbb_test_case class phpbb_convert_30_dbms_to_31_test extends phpbb_test_case
{ {
public function convert_30_dbms_to_31_data() public static function convert_30_dbms_to_31_data()
{ {
return array( return array(
array('mssql_odbc'), array('mssql_odbc'),

View file

@ -29,7 +29,7 @@ class phpbb_generate_string_list_test extends phpbb_test_case
$this->user->add_lang('common'); $this->user->add_lang('common');
} }
public function generate_string_list_data() public static function generate_string_list_data()
{ {
return array( return array(
array( array(

View file

@ -13,7 +13,7 @@
class phpbb_get_formatted_filesize_test extends phpbb_test_case class phpbb_get_formatted_filesize_test extends phpbb_test_case
{ {
public function get_formatted_filesize_test_data() public static function get_formatted_filesize_test_data()
{ {
return array( return array(
// exact powers of 2 // exact powers of 2

View file

@ -13,7 +13,7 @@
class phpbb_functions_get_preg_expression_test extends phpbb_test_case class phpbb_functions_get_preg_expression_test extends phpbb_test_case
{ {
public function data_path_remove_dot_trailing_slash() public static function data_path_remove_dot_trailing_slash()
{ {
return array( return array(
array('./../', '$2', '/..'), array('./../', '$2', '/..'),

View file

@ -17,7 +17,11 @@ class phpbb_functions_make_clickable_email_test extends phpbb_test_case
{ {
parent::setUp(); parent::setUp();
global $user, $request, $symfony_request; global $user, $request, $symfony_request, $config;
$config = new \phpbb\config\config([
'force_server_vars' => 0,
'server_name' => 'testhost',
]);
$user = new phpbb_mock_user(); $user = new phpbb_mock_user();
$request = new phpbb_mock_request(); $request = new phpbb_mock_request();
$symfony_request = new \phpbb\symfony_request($request); $symfony_request = new \phpbb\symfony_request($request);
@ -26,7 +30,7 @@ class phpbb_functions_make_clickable_email_test extends phpbb_test_case
/** /**
* 'e' tag for email addresses html * 'e' tag for email addresses html
**/ **/
public function data_test_make_clickable_email_positive() public static function data_test_make_clickable_email_positive()
{ {
return array( return array(
array( array(
@ -147,7 +151,7 @@ class phpbb_functions_make_clickable_email_test extends phpbb_test_case
); );
} }
public function data_test_make_clickable_email_negative() public static function data_test_make_clickable_email_negative()
{ {
return array( return array(
array('foo.example.com'), // @ is missing array('foo.example.com'), // @ is missing
@ -206,6 +210,7 @@ class phpbb_functions_make_clickable_email_test extends phpbb_test_case
*/ */
public function test_email_matching_positive($email, $expected) public function test_email_matching_positive($email, $expected)
{ {
global $config, $user, $request, $symfony_request;
$this->assertSame($expected, make_clickable($email)); $this->assertSame($expected, make_clickable($email));
} }
@ -214,6 +219,7 @@ class phpbb_functions_make_clickable_email_test extends phpbb_test_case
*/ */
public function test_email_matching_negative($email, $expected = null) public function test_email_matching_negative($email, $expected = null)
{ {
global $config, $user, $request, $symfony_request;
$expected = ($expected) ?: $email; $expected = ($expected) ?: $email;
$this->assertSame($expected, make_clickable($email)); $this->assertSame($expected, make_clickable($email));
} }

View file

@ -25,7 +25,7 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case
* "postlink" for the rest of URLs * "postlink" for the rest of URLs
* empty for email addresses * empty for email addresses
**/ **/
public function data_test_make_clickable_url_positive() public static function data_test_make_clickable_url_positive()
{ {
return [ return [
[ [
@ -82,7 +82,7 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case
]; ];
} }
public function data_test_make_clickable_url_idn() public static function data_test_make_clickable_url_idn()
{ {
return [ return [
[ [
@ -135,7 +135,7 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case
]; ];
} }
public function data_test_make_clickable_local_url_idn() public static function data_test_make_clickable_local_url_idn()
{ {
return [ return [
[ [
@ -154,7 +154,7 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case
]; ];
} }
public function data_test_make_clickable_custom_classes() public static function data_test_make_clickable_custom_classes()
{ {
return [ return [
[ [
@ -200,7 +200,11 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case
{ {
parent::setUp(); parent::setUp();
global $user, $request, $symfony_request; global $user, $request, $symfony_request, $config;
$config = new \phpbb\config\config([
'force_server_vars' => 0,
'server_name' => 'testhost',
]);
$user = new phpbb_mock_user(); $user = new phpbb_mock_user();
$request = new phpbb_mock_request(); $request = new phpbb_mock_request();
$symfony_request = new \phpbb\symfony_request($request); $symfony_request = new \phpbb\symfony_request($request);
@ -212,6 +216,7 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case
*/ */
public function test_urls_matching_positive($url, $expected) public function test_urls_matching_positive($url, $expected)
{ {
global $user, $request, $symfony_request, $config;
$this->assertSame($expected, make_clickable($url)); $this->assertSame($expected, make_clickable($url));
} }
@ -220,6 +225,7 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case
*/ */
public function test_local_urls_matching_idn($url, $expected) public function test_local_urls_matching_idn($url, $expected)
{ {
global $user, $request, $symfony_request, $config;
$this->assertSame($expected, make_clickable($url, "http://www.домен.рф")); $this->assertSame($expected, make_clickable($url, "http://www.домен.рф"));
} }
@ -228,6 +234,7 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case
*/ */
public function test_make_clickable_custom_classes($url, $server_url, $class, $expected) public function test_make_clickable_custom_classes($url, $server_url, $class, $expected)
{ {
global $user, $request, $symfony_request, $config;
$this->assertSame($expected, make_clickable($url, $server_url, $class)); $this->assertSame($expected, make_clickable($url, $server_url, $class));
} }
} }

View file

@ -33,7 +33,7 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case
); );
} }
static public function obtain_guest_count_data() public static function obtain_guest_count_data()
{ {
return array( return array(
array(0, 2), array(0, 2),
@ -53,7 +53,7 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case
$this->assertEquals($expected, obtain_guest_count($forum_id)); $this->assertEquals($expected, obtain_guest_count($forum_id));
} }
static public function obtain_users_online_data() public static function obtain_users_online_data()
{ {
return array( return array(
array(0, false, array( array(0, false, array(
@ -123,7 +123,7 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case
$this->assertEquals($expected, obtain_users_online($forum_id)); $this->assertEquals($expected, obtain_users_online($forum_id));
} }
static public function obtain_users_online_string_data() public static function obtain_users_online_string_data()
{ {
return array( return array(
array(0, false, array( array(0, false, array(

View file

@ -13,7 +13,7 @@
class phpbb_functions_parse_cfg_file_test extends phpbb_test_case class phpbb_functions_parse_cfg_file_test extends phpbb_test_case
{ {
public function parse_cfg_file_data() public static function parse_cfg_file_data()
{ {
return array( return array(
array( array(

View file

@ -61,7 +61,7 @@ class phpbb_get_banned_user_ids_test extends phpbb_database_test_case
$phpbb_container->set('ban.manager', $ban_manager); $phpbb_container->set('ban.manager', $ban_manager);
} }
public function phpbb_get_banned_user_ids_data() public static function phpbb_get_banned_user_ids_data()
{ {
return array( return array(
// Input to phpbb_get_banned_user_ids (user_id list, ban_end) // Input to phpbb_get_banned_user_ids (user_id list, ban_end)

View file

@ -13,7 +13,7 @@
class phpbb_get_install_redirect_test extends phpbb_test_case class phpbb_get_install_redirect_test extends phpbb_test_case
{ {
public function data_redirect(): array public static function data_redirect(): array
{ {
return [ return [
[ [

View file

@ -13,7 +13,7 @@
class phpbb_quoteattr_test extends phpbb_test_case class phpbb_quoteattr_test extends phpbb_test_case
{ {
public function quoteattr_test_data() public static function quoteattr_test_data()
{ {
return array( return array(
array('foo', null, '"foo"'), array('foo', null, '"foo"'),

View file

@ -13,7 +13,7 @@
class short_ipv6__test extends phpbb_test_case class short_ipv6__test extends phpbb_test_case
{ {
public function data_short_ipv6(): array public static function data_short_ipv6(): array
{ {
return [ return [
['::1', 0, ''], ['::1', 0, ''],

View file

@ -18,7 +18,7 @@ class phpbb_functions_style_select_test extends phpbb_database_test_case
return $this->createXMLDataSet(__DIR__.'/fixtures/style_select.xml'); return $this->createXMLDataSet(__DIR__.'/fixtures/style_select.xml');
} }
static public function style_select_data() public static function style_select_data()
{ {
return [ return [
[ [

View file

@ -15,7 +15,7 @@ require_once __DIR__ . '/../../phpBB/includes/functions_user.php';
class phpbb_functions_validate_hex_colour_test extends phpbb_test_case class phpbb_functions_validate_hex_colour_test extends phpbb_test_case
{ {
public function positive_match_data() public static function positive_match_data()
{ {
return array( return array(
array('a00'), array('a00'),
@ -27,7 +27,7 @@ class phpbb_functions_validate_hex_colour_test extends phpbb_test_case
); );
} }
public function negative_match_data() public static function negative_match_data()
{ {
return array( return array(
// Invalid prefix // Invalid prefix
@ -53,7 +53,7 @@ class phpbb_functions_validate_hex_colour_test extends phpbb_test_case
); );
} }
public function optional_only_data() public static function optional_only_data()
{ {
return array( return array(
// The empty colour, i.e. "no colour". // The empty colour, i.e. "no colour".
@ -61,19 +61,19 @@ class phpbb_functions_validate_hex_colour_test extends phpbb_test_case
); );
} }
public function strict_negative_match_data() public static function strict_negative_match_data()
{ {
return array_merge( return array_merge(
$this->negative_match_data(), self::negative_match_data(),
$this->optional_only_data() self::optional_only_data()
); );
} }
public function nonstrict_positive_match_data() public static function nonstrict_positive_match_data()
{ {
return array_merge( return array_merge(
$this->positive_match_data(), self::positive_match_data(),
$this->optional_only_data() self::optional_only_data()
); );
} }

View file

@ -25,7 +25,7 @@ class phpbb_functions_validate_password_test extends phpbb_test_case
$this->helper = new phpbb_functions_validate_data_helper($this); $this->helper = new phpbb_functions_validate_data_helper($this);
} }
public function validate_password_data() public static function validate_password_data()
{ {
return array( return array(
array('PASS_TYPE_ANY', array( array('PASS_TYPE_ANY', array(

View file

@ -28,12 +28,14 @@ class phpbb_functions_validate_user_email_test extends phpbb_database_test_case
protected function setUp(): void protected function setUp(): void
{ {
global $cache, $phpbb_container, $phpbb_dispatcher, $phpbb_root_path, $phpEx; global $cache, $phpbb_container, $phpbb_dispatcher, $phpbb_root_path, $phpEx, $config;
parent::setUp(); parent::setUp();
$phpbb_container = new phpbb_mock_container_builder(); $phpbb_container = new phpbb_mock_container_builder();
$config = new \phpbb\config\config([]); $config = new \phpbb\config\config([
'allow_emailreuse' => 0,
]);
$this->db = $this->new_dbal(); $this->db = $this->new_dbal();
$phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$language = new phpbb\language\language(new phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); $language = new phpbb\language\language(new phpbb\language\language_file_loader($phpbb_root_path, $phpEx));
@ -99,6 +101,8 @@ class phpbb_functions_validate_user_email_test extends phpbb_database_test_case
*/ */
public function test_validate_user_email($case, $errors, $email) public function test_validate_user_email($case, $errors, $email)
{ {
global $config, $db, $user;
$this->set_validation_prerequisites(false); $this->set_validation_prerequisites(false);
$this->helper->assert_valid_data(array( $this->helper->assert_valid_data(array(
@ -124,6 +128,8 @@ class phpbb_functions_validate_user_email_test extends phpbb_database_test_case
*/ */
public function test_validate_user_email_mx($case, $errors, $email) public function test_validate_user_email_mx($case, $errors, $email)
{ {
global $config, $db, $user;
$this->set_validation_prerequisites(true); $this->set_validation_prerequisites(true);
$this->helper->assert_valid_data(array( $this->helper->assert_valid_data(array(

View file

@ -35,7 +35,7 @@ class phpbb_functions_validate_username_test extends phpbb_database_test_case
$this->helper = new phpbb_functions_validate_data_helper($this); $this->helper = new phpbb_functions_validate_data_helper($this);
} }
public function validate_username_data() public static function validate_username_data()
{ {
return array( return array(
array('USERNAME_CHARS_ANY', array( array('USERNAME_CHARS_ANY', array(

View file

@ -15,7 +15,7 @@ require_once __DIR__ . '/../../phpBB/includes/functions_acp.php';
class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
{ {
public function build_cfg_template_text_data() public static function build_cfg_template_text_data()
{ {
return array( return array(
array( array(
@ -84,7 +84,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
$this->assertEquals($expected, phpbb_build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); $this->assertEquals($expected, phpbb_build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
} }
public function build_cfg_template_dimension_data() public static function build_cfg_template_dimension_data()
{ {
return array( return array(
array( array(
@ -154,7 +154,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
$this->assertEquals($expected, phpbb_build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); $this->assertEquals($expected, phpbb_build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
} }
public function build_cfg_template_number_data() public static function build_cfg_template_number_data()
{ {
return array( return array(
array( array(
@ -222,7 +222,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
$this->assertEquals($expected, phpbb_build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); $this->assertEquals($expected, phpbb_build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
} }
public function build_cfg_template_textarea_data() public static function build_cfg_template_textarea_data()
{ {
return array( return array(
array( array(
@ -257,7 +257,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
$this->assertEquals($expected, phpbb_build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); $this->assertEquals($expected, phpbb_build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
} }
public function build_cfg_template_radio_data() public static function build_cfg_template_radio_data()
{ {
return [ return [
[ [
@ -492,7 +492,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
$this->assertEquals($expected, phpbb_build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); $this->assertEquals($expected, phpbb_build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
} }
public function build_cfg_template_append_data() public static function build_cfg_template_append_data()
{ {
return array( return array(
array( array(
@ -528,7 +528,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
$this->assertEquals($expected, phpbb_build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); $this->assertEquals($expected, phpbb_build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
} }
public function build_cfg_template_select_data() public static function build_cfg_template_select_data()
{ {
return [ return [
[ [

View file

@ -25,7 +25,7 @@ class phpbb_functions_acp_build_select_test extends phpbb_test_case
$user->lang = new phpbb_mock_lang(); $user->lang = new phpbb_mock_lang();
} }
public function build_select_data() public static function build_select_data()
{ {
return array( return array(
array( array(

View file

@ -27,7 +27,7 @@ class phpbb_functions_insert_config_array_test extends phpbb_test_case
); );
} }
public function insert_config_array_data() public static function insert_config_array_data()
{ {
return array( return array(
array( // Add a new config after 1st array item array( // Add a new config after 1st array item

View file

@ -29,7 +29,7 @@ class phpbb_functions_acp_validate_config_vars_test extends phpbb_test_case
/** /**
* Data sets that don't throw an error. * Data sets that don't throw an error.
*/ */
public function validate_config_vars_fit_data() public static function validate_config_vars_fit_data()
{ {
return array( return array(
array( array(
@ -86,7 +86,7 @@ class phpbb_functions_acp_validate_config_vars_test extends phpbb_test_case
/** /**
* Data sets that throw the error. * Data sets that throw the error.
*/ */
public function validate_config_vars_error_data() public static function validate_config_vars_error_data()
{ {
return array( return array(
array( array(

View file

@ -28,7 +28,7 @@ class phpbb_functions_acp_validate_range_test extends phpbb_test_case
/** /**
* Data sets that don't throw an error. * Data sets that don't throw an error.
*/ */
public function validate_range_data_fit() public static function validate_range_data_fit()
{ {
return array( return array(
array(array(array('column_type' => 'BOOL', 'lang' => 'TEST', 'value' => 0))), array(array(array('column_type' => 'BOOL', 'lang' => 'TEST', 'value' => 0))),
@ -74,7 +74,7 @@ class phpbb_functions_acp_validate_range_test extends phpbb_test_case
/** /**
* Data sets that throw the SETTING_TOO_LOW-error. * Data sets that throw the SETTING_TOO_LOW-error.
*/ */
public function validate_range_data_too_low() public static function validate_range_data_too_low()
{ {
return array( return array(
array(array(array('column_type' => 'BOOL', 'lang' => 'TEST', 'value' => -1))), array(array(array('column_type' => 'BOOL', 'lang' => 'TEST', 'value' => -1))),
@ -109,7 +109,7 @@ class phpbb_functions_acp_validate_range_test extends phpbb_test_case
/** /**
* Data sets that throw the SETTING_TOO_BIG-error. * Data sets that throw the SETTING_TOO_BIG-error.
*/ */
public function validate_range_data_too_big() public static function validate_range_data_too_big()
{ {
return array( return array(
array(array(array('column_type' => 'BOOL', 'lang' => 'TEST', 'value' => 2))), array(array(array('column_type' => 'BOOL', 'lang' => 'TEST', 'value' => 2))),
@ -144,7 +144,7 @@ class phpbb_functions_acp_validate_range_test extends phpbb_test_case
/** /**
* Data sets that throw the SETTING_TOO_LONG-error. * Data sets that throw the SETTING_TOO_LONG-error.
*/ */
public function validate_range_data_too_long() public static function validate_range_data_too_long()
{ {
return array( return array(
array(array(array('column_type' => 'VCHAR', 'lang' => 'TEST', 'value' => str_repeat('a', 256)))), array(array(array('column_type' => 'VCHAR', 'lang' => 'TEST', 'value' => str_repeat('a', 256)))),

View file

@ -20,7 +20,7 @@ class phpbb_functions_content_get_context_test extends TestCase
* *
* @return array * @return array
*/ */
public function data_get_context(): array public static function data_get_context(): array
{ {
return [ return [
'text contains words and length greater than text' => [ 'text contains words and length greater than text' => [
@ -121,7 +121,7 @@ class phpbb_functions_content_get_context_test extends TestCase
* *
* @return array * @return array
*/ */
public function data_get_context_unicode(): array public static function data_get_context_unicode(): array
{ {
return [ return [
'text contains words and length greater than text unicode' => [ 'text contains words and length greater than text unicode' => [

View file

@ -30,7 +30,7 @@ class phpbb_functions_content_get_username_string_test extends phpbb_test_case
$user->lang['GUEST'] = 'Guest'; $user->lang['GUEST'] = 'Guest';
} }
public function get_username_string_profile_data() public static function get_username_string_profile_data()
{ {
global $phpbb_root_path, $phpEx; global $phpbb_root_path, $phpEx;
@ -49,7 +49,7 @@ class phpbb_functions_content_get_username_string_test extends phpbb_test_case
$this->assertEquals($expected, get_username_string('profile', $user_id, $username, $user_colour, $guest_username, $custom_profile_url)); $this->assertEquals($expected, get_username_string('profile', $user_id, $username, $user_colour, $guest_username, $custom_profile_url));
} }
public function get_username_string_username_data() public static function get_username_string_username_data()
{ {
return array( return array(
array(ANONYMOUS, '', '', false, false, 'Guest'), array(ANONYMOUS, '', '', false, false, 'Guest'),
@ -68,7 +68,7 @@ class phpbb_functions_content_get_username_string_test extends phpbb_test_case
$this->assertEquals($expected, get_username_string('username', $user_id, $username, $user_colour, $guest_username, $custom_profile_url)); $this->assertEquals($expected, get_username_string('username', $user_id, $username, $user_colour, $guest_username, $custom_profile_url));
} }
public function get_username_string_colour_data() public static function get_username_string_colour_data()
{ {
return array( return array(
array(0, '', '', false, false, ''), array(0, '', '', false, false, ''),
@ -86,7 +86,7 @@ class phpbb_functions_content_get_username_string_test extends phpbb_test_case
$this->assertEquals($expected, get_username_string('colour', $user_id, $username, $user_colour, $guest_username, $custom_profile_url)); $this->assertEquals($expected, get_username_string('colour', $user_id, $username, $user_colour, $guest_username, $custom_profile_url));
} }
public function get_username_string_full_data() public static function get_username_string_full_data()
{ {
global $phpbb_root_path, $phpEx; global $phpbb_root_path, $phpEx;
@ -107,7 +107,7 @@ class phpbb_functions_content_get_username_string_test extends phpbb_test_case
$this->assertEquals($expected, get_username_string('full', $user_id, $username, $user_colour, $guest_username, $custom_profile_url)); $this->assertEquals($expected, get_username_string('full', $user_id, $username, $user_colour, $guest_username, $custom_profile_url));
} }
public function get_username_string_no_profile_data() public static function get_username_string_no_profile_data()
{ {
return array( return array(
array(ANONYMOUS, 'Anonymous', '', false, false, '<span class="username">Anonymous</span>'), array(ANONYMOUS, 'Anonymous', '', false, false, '<span class="username">Anonymous</span>'),

View file

@ -13,7 +13,7 @@
class phpbb_functions_content_phpbb_clean_search_string_test extends phpbb_test_case class phpbb_functions_content_phpbb_clean_search_string_test extends phpbb_test_case
{ {
public function phpbb_clean_search_string_data() public static function phpbb_clean_search_string_data()
{ {
return array( return array(
array('*', ''), array('*', ''),

View file

@ -31,7 +31,7 @@ class phpbb_functions_content_phpbb_format_quote_test extends phpbb_test_case
parent::setUp(); parent::setUp();
} }
public function data_phpbb_format_quote() public static function data_phpbb_format_quote()
{ {
return [ return [
[true, ['author' => 'admin', 'user_id' => 2], '[quote=&quot;username&quot;]quoted[/quote]', '', "[quote=admin user_id=2][quote=&quot;username&quot;]quoted[/quote][/quote]\n\n"], [true, ['author' => 'admin', 'user_id' => 2], '[quote=&quot;username&quot;]quoted[/quote]', '', "[quote=admin user_id=2][quote=&quot;username&quot;]quoted[/quote][/quote]\n\n"],

View file

@ -68,7 +68,7 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
$phpbb_container->setParameter('tables.user_notifications', 'phpbb_user_notifications'); $phpbb_container->setParameter('tables.user_notifications', 'phpbb_user_notifications');
} }
public function first_last_post_data() public static function first_last_post_data()
{ {
return array( return array(
array( array(
@ -227,7 +227,7 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);
} }
public function report_attachment_data() public static function report_attachment_data()
{ {
return array( return array(
array( array(
@ -311,7 +311,7 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);
} }
public function delete_data() public static function delete_data()
{ {
return array( return array(
array( array(
@ -397,7 +397,7 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);
} }
public function delete_user_id_data() public static function delete_user_id_data()
{ {
return array( return array(
array( array(

View file

@ -20,7 +20,7 @@ class phpbb_functions_user_group_user_attributes_test extends phpbb_database_tes
return $this->createXMLDataSet(__DIR__.'/fixtures/group_user_attributes.xml'); return $this->createXMLDataSet(__DIR__.'/fixtures/group_user_attributes.xml');
} }
public function group_user_attributes_data() public static function group_user_attributes_data()
{ {
return array( return array(
array( array(

View file

@ -30,7 +30,7 @@ class phpbb_functions_user_whois_test extends phpbb_test_case
->getMock(); ->getMock();
} }
public function ips_data() public static function ips_data()
{ {
return [ return [
['2001:4860:4860::8888'], // Google public DNS ['2001:4860:4860::8888'], // Google public DNS

Some files were not shown because too many files have changed in this diff Show more