diff options
Diffstat (limited to 'tests')
186 files changed, 273 insertions, 254 deletions
diff --git a/tests/acp_board/select_auth_method_test.php b/tests/acp_board/select_auth_method_test.php index 16e5954c64..3cb8ea7cd6 100644 --- a/tests/acp_board/select_auth_method_test.php +++ b/tests/acp_board/select_auth_method_test.php @@ -27,7 +27,7 @@ class phpbb_acp_board_select_auth_method_test extends phpbb_test_case ); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/attachment/delete_test.php b/tests/attachment/delete_test.php index 5ea9f26ea0..59669c87e9 100644 --- a/tests/attachment/delete_test.php +++ b/tests/attachment/delete_test.php @@ -24,6 +24,9 @@ class phpbb_attachment_delete_test extends \phpbb_database_test_case /** @var \phpbb\filesystem\filesystem */ protected $filesystem; + /** @var \phpbb\event\dispatcher_interface */ + protected $dispatcher; + /** @var \phpbb\attachment\resync */ protected $resync; @@ -37,9 +40,9 @@ class phpbb_attachment_delete_test extends \phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/resync.xml'); } - public function setUp() + public function setUp(): void { - global $db, $phpbb_root_path; + global $phpbb_root_path; parent::setUp(); diff --git a/tests/attachment/manager_test.php b/tests/attachment/manager_test.php index 47d7f38b1d..c440dcf101 100644 --- a/tests/attachment/manager_test.php +++ b/tests/attachment/manager_test.php @@ -17,7 +17,7 @@ class phpbb_attachment_manager_test extends \phpbb_test_case protected $resync; protected $upload; - public function setUp() + public function setUp(): void { $this->delete = $this->getMockBuilder('\phpbb\attachment\delete') ->disableOriginalConstructor() diff --git a/tests/attachment/resync_test.php b/tests/attachment/resync_test.php index f882af9ae5..de5ead5bff 100644 --- a/tests/attachment/resync_test.php +++ b/tests/attachment/resync_test.php @@ -24,7 +24,7 @@ class phpbb_attachment_resync_test extends \phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/resync.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/attachment/upload_test.php b/tests/attachment/upload_test.php index 6aaae6ad61..a3f51dd34e 100644 --- a/tests/attachment/upload_test.php +++ b/tests/attachment/upload_test.php @@ -67,7 +67,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/resync.xml'); } - public function setUp() + public function setUp(): void { global $config, $phpbb_root_path, $phpEx; diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php index f30d19ef9d..0c26a0a186 100644 --- a/tests/auth/provider_apache_test.php +++ b/tests/auth/provider_apache_test.php @@ -17,7 +17,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case protected $user; protected $request; - protected function setup() + protected function setup(): void { parent::setUp(); diff --git a/tests/auth/provider_oauth_token_storage_test.php b/tests/auth/provider_oauth_token_storage_test.php index ae5de6aa7e..0c0e55dec6 100644 --- a/tests/auth/provider_oauth_token_storage_test.php +++ b/tests/auth/provider_oauth_token_storage_test.php @@ -25,7 +25,7 @@ class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_c protected $state_table; protected $user; - protected function setup() + protected function setup(): void { parent::setUp(); @@ -73,7 +73,10 @@ class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_c $token = $cache_token; } - $this->setExpectedException($exception); + if (!empty($exception)) + { + $this->expectException($exception); + } $stored_token = $this->token_storage->retrieveAccessToken($this->service_name); $this->assertEquals($token, $stored_token); @@ -120,7 +123,10 @@ class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_c $token = $cache_token; } - $this->setExpectedException($exception); + if (!empty($exception)) + { + $this->expectException($exception); + } $stored_token = $this->token_storage->retrieve_access_token_by_session($this->service_name); $this->assertEquals($token, $stored_token); diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php index 68636f2532..81a0655e02 100644 --- a/tests/avatar/manager_test.php +++ b/tests/avatar/manager_test.php @@ -25,7 +25,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/users.xml'); } - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; diff --git a/tests/cache/apc_driver_test.php b/tests/cache/apc_driver_test.php index 706f274448..276cbeb3e1 100644 --- a/tests/cache/apc_driver_test.php +++ b/tests/cache/apc_driver_test.php @@ -20,7 +20,6 @@ require_once dirname(__FILE__) . '/common_test_case.php'; class phpbb_cache_apc_driver_test extends phpbb_cache_common_test_case { protected static $config; - protected $driver; public function getDataSet() { @@ -47,7 +46,7 @@ class phpbb_cache_apc_driver_test extends phpbb_cache_common_test_case } } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/cache/apcu_driver_test.php b/tests/cache/apcu_driver_test.php index 57f640c313..34bcf8f844 100644 --- a/tests/cache/apcu_driver_test.php +++ b/tests/cache/apcu_driver_test.php @@ -20,7 +20,6 @@ require_once dirname(__FILE__) . '/common_test_case.php'; class phpbb_cache_apcu_driver_test extends phpbb_cache_common_test_case { protected static $config; - protected $driver; public function getDataSet() { @@ -45,9 +44,11 @@ class phpbb_cache_apcu_driver_test extends phpbb_cache_common_test_case { self::markTestSkipped('APCu is not enabled for CLI. Set apc.enable_cli=1 in php.ini'); } + + parent::setUpBeforeClass(); } - protected function setUp() + protected function setUp(): void { global $phpbb_container, $phpbb_root_path; diff --git a/tests/cache/cache_memory_test.php b/tests/cache/cache_memory_test.php index ba1010bcf3..b3d19f1782 100644 --- a/tests/cache/cache_memory_test.php +++ b/tests/cache/cache_memory_test.php @@ -23,7 +23,7 @@ class phpbb_cache_memory_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/cache_memory.xml'); } - protected function setUp() + protected function setUp(): void { global $db; parent::setUp(); diff --git a/tests/cache/common_test_case.php b/tests/cache/common_test_case.php index ee0649a755..64273c250a 100644 --- a/tests/cache/common_test_case.php +++ b/tests/cache/common_test_case.php @@ -13,6 +13,9 @@ abstract class phpbb_cache_common_test_case extends phpbb_database_test_case { + /** @var \phpbb\cache\driver\driver_interface */ + protected $driver; + public function test_get_put_exists() { $this->assertFalse($this->driver->_exists('test_key')); diff --git a/tests/cache/dummy_driver_test.php b/tests/cache/dummy_driver_test.php index 6cb6b73729..6802e120ab 100644 --- a/tests/cache/dummy_driver_test.php +++ b/tests/cache/dummy_driver_test.php @@ -13,14 +13,12 @@ class phpbb_cache_dummy_driver_test extends phpbb_database_test_case { - protected $driver; - public function getDataSet() { return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/cache/file_driver_test.php b/tests/cache/file_driver_test.php index 471316847d..37973edba3 100644 --- a/tests/cache/file_driver_test.php +++ b/tests/cache/file_driver_test.php @@ -16,22 +16,18 @@ require_once dirname(__FILE__) . '/common_test_case.php'; class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case { private $cache_dir; - protected $driver; - - public function __construct() - { - $this->cache_dir = dirname(__FILE__) . '/../tmp/cache/'; - } public function getDataSet() { return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); + $this->cache_dir = dirname(__FILE__) . '/../tmp/cache/'; + if (file_exists($this->cache_dir)) { // cache directory possibly left after aborted @@ -43,7 +39,7 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case $this->driver = new \phpbb\cache\driver\file($this->cache_dir); } - protected function tearDown() + protected function tearDown(): void { if (file_exists($this->cache_dir)) { diff --git a/tests/cache/redis_driver_test.php b/tests/cache/redis_driver_test.php index 387e6ca855..a2288cf9a8 100644 --- a/tests/cache/redis_driver_test.php +++ b/tests/cache/redis_driver_test.php @@ -13,10 +13,9 @@ require_once dirname(__FILE__) . '/common_test_case.php'; -class phpbb_cache_redis_driver_test extends phpbb_cache_common_test_case +class phpbb_cache_redis_driver_test extends \phpbb_cache_common_test_case { protected static $config; - protected $driver; public function getDataSet() { @@ -41,12 +40,18 @@ class phpbb_cache_redis_driver_test extends phpbb_cache_common_test_case { self::markTestSkipped('Test redis host/port is not specified'); } + + parent::setUpBeforeClass(); } - protected function setUp() + protected function setUp(): void { + global $phpbb_root_path, $phpbb_container; + parent::setUp(); + $phpbb_container = new phpbb_mock_container_builder(); + $phpbb_container->setParameter('core.cache_dir', $phpbb_root_path . 'cache/' . PHPBB_ENVIRONMENT . '/'); $this->driver = new \phpbb\cache\driver\redis(self::$config['host'], self::$config['port']); $this->driver->purge(); } diff --git a/tests/captcha/qa_test.php b/tests/captcha/qa_test.php index 7ec4be69f5..0856bbd3c3 100644 --- a/tests/captcha/qa_test.php +++ b/tests/captcha/qa_test.php @@ -23,7 +23,7 @@ class phpbb_captcha_qa_test extends \phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml'); } - public function setUp() + public function setUp(): void { global $db, $request, $phpbb_container; diff --git a/tests/class_loader/class_loader_test.php b/tests/class_loader/class_loader_test.php index ffb14b0720..60d8d26b13 100644 --- a/tests/class_loader/class_loader_test.php +++ b/tests/class_loader/class_loader_test.php @@ -13,7 +13,7 @@ class phpbb_class_loader_test extends \phpbb_test_case { - public function setUp() + public function setUp(): void { global $phpbb_class_loader; $phpbb_class_loader->unregister(); @@ -22,7 +22,7 @@ class phpbb_class_loader_test extends \phpbb_test_case $phpbb_class_loader_ext->unregister(); } - public function tearDown() + public function tearDown(): void { global $phpbb_class_loader_ext; $phpbb_class_loader_ext->register(); diff --git a/tests/compress/compress_test.php b/tests/compress/compress_test.php index c071a049a8..f67726c205 100644 --- a/tests/compress/compress_test.php +++ b/tests/compress/compress_test.php @@ -34,7 +34,7 @@ class phpbb_compress_test extends phpbb_test_case 'dir/2_1.txt', ); - protected function setUp() + protected function setUp(): void { // Required for compress::add_file global $phpbb_root_path; @@ -54,7 +54,7 @@ class phpbb_compress_test extends phpbb_test_case } } - protected function tearDown() + protected function tearDown(): void { foreach (array(dirname(__FILE__) . self::EXTRACT_DIR, dirname(__FILE__) . self::ARCHIVE_DIR) as $dir) { diff --git a/tests/config/db_test.php b/tests/config/db_test.php index 713e6cb6d9..46addc9d38 100644 --- a/tests/config/db_test.php +++ b/tests/config/db_test.php @@ -22,7 +22,7 @@ class phpbb_config_db_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/config/db_text_test.php b/tests/config/db_text_test.php index a91abf990f..0683abc1a9 100644 --- a/tests/config/db_text_test.php +++ b/tests/config/db_text_test.php @@ -21,7 +21,7 @@ class phpbb_config_db_text_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config_text.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/console/cache/purge_test.php b/tests/console/cache/purge_test.php index 7a7e1dee5c..2bb4252c41 100644 --- a/tests/console/cache/purge_test.php +++ b/tests/console/cache/purge_test.php @@ -25,15 +25,12 @@ class phpbb_console_command_cache_purge_test extends phpbb_test_case protected $db; protected $config; - public function __construct() - { - $this->cache_dir = dirname(__FILE__) . '/tmp/cache/'; - } - - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx; + $this->cache_dir = dirname(__FILE__) . '/tmp/cache/'; + if (file_exists($this->cache_dir)) { // cache directory possibly left after aborted diff --git a/tests/console/config/config_test.php b/tests/console/config/config_test.php index 7f8b2efce2..65bfad4757 100644 --- a/tests/console/config/config_test.php +++ b/tests/console/config/config_test.php @@ -20,7 +20,7 @@ class phpbb_console_command_config_test extends phpbb_test_case protected $command_name; protected $user; - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; diff --git a/tests/console/cron/cron_list_test.php b/tests/console/cron/cron_list_test.php index bfc897ac2e..8c7424c50d 100644 --- a/tests/console/cron/cron_list_test.php +++ b/tests/console/cron/cron_list_test.php @@ -30,7 +30,7 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case protected $command_tester; - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx; diff --git a/tests/console/cron/run_test.php b/tests/console/cron/run_test.php index 76c7bb27c4..2744bf132c 100644 --- a/tests/console/cron/run_test.php +++ b/tests/console/cron/run_test.php @@ -32,7 +32,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); } - public function setUp() + public function setUp(): void { global $db, $config, $phpbb_root_path, $phpEx; diff --git a/tests/console/thumbnail_test.php b/tests/console/thumbnail_test.php index f74ed6ead7..8f4da5a414 100644 --- a/tests/console/thumbnail_test.php +++ b/tests/console/thumbnail_test.php @@ -32,7 +32,7 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/thumbnail.xml'); } - public function setUp() + public function setUp(): void { global $config, $phpbb_root_path, $phpEx, $phpbb_filesystem; @@ -76,7 +76,7 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case copy(dirname(__FILE__) . '/fixtures/txt.txt', $this->phpbb_root_path . 'files/test_txt'); } - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); diff --git a/tests/console/user/activate_test.php b/tests/console/user/activate_test.php index 1588a76e47..51e9754b59 100644 --- a/tests/console/user/activate_test.php +++ b/tests/console/user/activate_test.php @@ -21,7 +21,7 @@ class phpbb_console_user_activate_test extends phpbb_console_user_base { protected $notifications; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/console/user/add_test.php b/tests/console/user/add_test.php index bdfb8a8d2a..cc86cb27d3 100644 --- a/tests/console/user/add_test.php +++ b/tests/console/user/add_test.php @@ -61,7 +61,10 @@ class phpbb_console_user_add_test extends phpbb_console_user_base $output->writeln(print_r($response, true)); return $response; }; - $helper = $this->getMock('\Symfony\Component\Console\Helper\QuestionHelper', array('ask')); + $helper = $this->getMockBuilder('\Symfony\Component\Console\Helper\QuestionHelper') + ->setMethods(['ask']) + ->disableOriginalConstructor() + ->getMock(); $helper->expects($this->any()) ->method('ask') ->will($this->returnCallback($ask)); diff --git a/tests/console/user/base.php b/tests/console/user/base.php index c3e40b3cb0..f8616b400f 100644 --- a/tests/console/user/base.php +++ b/tests/console/user/base.php @@ -30,7 +30,7 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); } - public function setUp() + public function setUp(): void { global $auth, $db, $cache, $config, $user, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path, $phpEx; diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php index 21a7cfd182..447c10d10e 100644 --- a/tests/controller/common_helper_route.php +++ b/tests/controller/common_helper_route.php @@ -29,7 +29,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case private $router; private $routing_helper; - public function setUp() + public function setUp(): void { global $phpbb_dispatcher, $phpbb_root_path, $phpEx; diff --git a/tests/controller/controller_test.php b/tests/controller/controller_test.php index 34839e65d0..ddc1921b0e 100644 --- a/tests/controller/controller_test.php +++ b/tests/controller/controller_test.php @@ -21,7 +21,7 @@ use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; class phpbb_controller_controller_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { $this->extension_manager = new phpbb_mock_extension_manager( dirname(__FILE__) . '/', @@ -128,7 +128,8 @@ class phpbb_controller_controller_test extends phpbb_test_case if (!empty($exception)) { - $this->setExpectedException($exception, $exception_message); + $this->expectException($exception); + $this->expectExceptionMessage($exception_message); } $this->assertEquals($expected, $resolver->getArguments($symfony_request, $input)); diff --git a/tests/cron/manager_test.php b/tests/cron/manager_test.php index 610f662b7d..f025e38cd5 100644 --- a/tests/cron/manager_test.php +++ b/tests/cron/manager_test.php @@ -20,7 +20,7 @@ require_once dirname(__FILE__) . '/tasks/simple_should_not_run.php'; class phpbb_cron_manager_test extends \phpbb_test_case { - public function setUp() + public function setUp(): void { $this->manager = $this->create_cron_manager(array( new phpbb_cron_task_core_dummy_task(), diff --git a/tests/dbal/auto_increment_test.php b/tests/dbal/auto_increment_test.php index 950a4fc8f7..27d10d2843 100644 --- a/tests/dbal/auto_increment_test.php +++ b/tests/dbal/auto_increment_test.php @@ -23,7 +23,7 @@ class phpbb_dbal_auto_increment_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -42,7 +42,7 @@ class phpbb_dbal_auto_increment_test extends phpbb_database_test_case $this->table_exists = true; } - protected function tearDown() + protected function tearDown(): void { if ($this->table_exists) { diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php index 818d8d8e17..20ea2b3729 100644 --- a/tests/dbal/db_tools_test.php +++ b/tests/dbal/db_tools_test.php @@ -25,7 +25,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -77,7 +77,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case $this->table_exists = true; } - protected function tearDown() + protected function tearDown(): void { if ($this->table_exists) { diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index 09283b8e24..7d6b100449 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -44,7 +44,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/dbal/migrator_tool_config_test.php b/tests/dbal/migrator_tool_config_test.php index 13e0c13e3c..74d816dbcd 100644 --- a/tests/dbal/migrator_tool_config_test.php +++ b/tests/dbal/migrator_tool_config_test.php @@ -13,7 +13,7 @@ class phpbb_dbal_migrator_tool_config_test extends phpbb_test_case { - public function setup() + public function setUp(): void { $this->config = new \phpbb\config\config(array()); diff --git a/tests/dbal/migrator_tool_config_text_test.php b/tests/dbal/migrator_tool_config_text_test.php index b271c2d62e..051e0a7556 100644 --- a/tests/dbal/migrator_tool_config_text_test.php +++ b/tests/dbal/migrator_tool_config_text_test.php @@ -18,7 +18,7 @@ class phpbb_dbal_migrator_tool_config_text_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_config_text.xml'); } - public function setup() + public function setUp(): void { parent::setup(); diff --git a/tests/dbal/migrator_tool_module_test.php b/tests/dbal/migrator_tool_module_test.php index 46045d2371..ecc7b384e7 100644 --- a/tests/dbal/migrator_tool_module_test.php +++ b/tests/dbal/migrator_tool_module_test.php @@ -21,7 +21,7 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_module.xml'); } - public function setup() + public function setUp(): void { // Need global $db, $user for delete_module function in acp_modules global $phpbb_root_path, $phpEx, $skip_add_log, $db, $user, $phpbb_log; diff --git a/tests/dbal/migrator_tool_permission_test.php b/tests/dbal/migrator_tool_permission_test.php index ccad6a1387..a48c367896 100644 --- a/tests/dbal/migrator_tool_permission_test.php +++ b/tests/dbal/migrator_tool_permission_test.php @@ -24,7 +24,7 @@ class phpbb_dbal_migrator_tool_permission_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_permission.xml'); } - public function setup() + public function setUp(): void { // Global $db and $cache are needed in acp/auth.php constructor global $phpbb_root_path, $phpEx, $db, $cache; diff --git a/tests/dbal/sql_affected_rows_test.php b/tests/dbal/sql_affected_rows_test.php index 07d7318358..e9fb1f2724 100644 --- a/tests/dbal/sql_affected_rows_test.php +++ b/tests/dbal/sql_affected_rows_test.php @@ -16,7 +16,7 @@ class phpbb_dbal_sql_affected_rows_test extends phpbb_database_test_case /** @var \phpbb\db\driver\driver_interface */ protected $db; - public function setUp() + public function setUp(): void { parent::setUp(); $this->db = $this->new_dbal(); diff --git a/tests/dbal/sql_insert_buffer_test.php b/tests/dbal/sql_insert_buffer_test.php index eae0abceba..b0e678b9da 100644 --- a/tests/dbal/sql_insert_buffer_test.php +++ b/tests/dbal/sql_insert_buffer_test.php @@ -16,7 +16,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case protected $db; protected $buffer; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/di/create_container_test.php b/tests/di/create_container_test.php index 1fd2cbd7ee..8ecad71412 100644 --- a/tests/di/create_container_test.php +++ b/tests/di/create_container_test.php @@ -26,7 +26,7 @@ namespace protected $phpbb_root_path; protected $filename; - public function setUp() + public function setUp(): void { $this->phpbb_root_path = dirname(__FILE__) . '/'; $this->config_php = new \phpbb\config_php_file($this->phpbb_root_path . 'fixtures/', 'php'); diff --git a/tests/di/ordered_service_collection_test.php b/tests/di/ordered_service_collection_test.php index 47e6d23744..baa9776573 100644 --- a/tests/di/ordered_service_collection_test.php +++ b/tests/di/ordered_service_collection_test.php @@ -18,7 +18,7 @@ class phpbb_ordered_service_collection_test extends \phpbb_test_case */ protected $service_collection; - public function setUp() + public function setUp(): void { $container = new phpbb_mock_container_builder(); $container->set('foo', new StdClass); diff --git a/tests/di/service_collection_test.php b/tests/di/service_collection_test.php index 5815b4367d..97c13ab163 100644 --- a/tests/di/service_collection_test.php +++ b/tests/di/service_collection_test.php @@ -18,7 +18,7 @@ class phpbb_service_collection_test extends \phpbb_test_case */ protected $service_collection; - public function setUp() + public function setUp(): void { $container = new phpbb_mock_container_builder(); $container->set('foo', new StdClass); @@ -56,14 +56,16 @@ class phpbb_service_collection_test extends \phpbb_test_case public function test_get_by_class_many_services_exception() { - $this->setExpectedException('RuntimeException', 'More than one service definitions found for class "bar_class" in collection.'); + $this->expectException('RuntimeException'); + $this->expectExceptionMessage('More than one service definitions found for class "bar_class" in collection.'); $this->service_collection->get_by_class('bar_class'); } public function test_get_by_class_no_service_exception() { - $this->setExpectedException('RuntimeException', 'No service found for class "baz_class" in collection.'); + $this->expectException('RuntimeException'); + $this->expectExceptionMessage('No service found for class "baz_class" in collection.'); $this->service_collection->get_by_class('baz_class'); } diff --git a/tests/email/email_parsing_test.php b/tests/email/email_parsing_test.php index 182517a039..629df9abb6 100644 --- a/tests/email/email_parsing_test.php +++ b/tests/email/email_parsing_test.php @@ -19,7 +19,7 @@ class phpbb_email_parsing_test extends phpbb_test_case /** @var \ReflectionProperty */ protected $reflection_template_property; - public function setUp() + public function setUp(): void { global $phpbb_container, $config, $phpbb_root_path, $phpEx, $request, $user; diff --git a/tests/error_collector_test.php b/tests/error_collector_test.php index 8ed89bbe52..c7701cfad0 100644 --- a/tests/error_collector_test.php +++ b/tests/error_collector_test.php @@ -13,7 +13,7 @@ class phpbb_error_collector_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/event/export_php_test.php b/tests/event/export_php_test.php index 21bbb0620a..92280b6f4f 100644 --- a/tests/event/export_php_test.php +++ b/tests/event/export_php_test.php @@ -16,7 +16,7 @@ class phpbb_event_export_php_test extends phpbb_test_case /** @var \phpbb\event\php_exporter */ protected $exporter; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/event/php_exporter_test.php b/tests/event/php_exporter_test.php index c6670e1340..78beb9f372 100644 --- a/tests/event/php_exporter_test.php +++ b/tests/event/php_exporter_test.php @@ -16,7 +16,7 @@ class phpbb_event_php_exporter_test extends phpbb_test_case /** @var \phpbb\event\php_exporter */ protected $exporter; - public function setUp() + public function setUp(): void { parent::setUp(); $this->exporter = new \phpbb\event\php_exporter(dirname(__FILE__) . '/fixtures/'); diff --git a/tests/extension/extension_base_test.php b/tests/extension/extension_base_test.php index e0c2e6d549..1f44fdb234 100644 --- a/tests/extension/extension_base_test.php +++ b/tests/extension/extension_base_test.php @@ -30,7 +30,7 @@ class phpbb_extension_extension_base_test extends phpbb_test_case self::$reflection_method_get_migration_file_list->setAccessible(true); } - public function setUp() + public function setUp(): void { $container = new phpbb_mock_container_builder(); $migrator = new phpbb_mock_migrator(); diff --git a/tests/extension/finder_test.php b/tests/extension/finder_test.php index 967876b9ae..7649b4f19a 100644 --- a/tests/extension/finder_test.php +++ b/tests/extension/finder_test.php @@ -18,7 +18,7 @@ class phpbb_extension_finder_test extends phpbb_test_case /** @var \phpbb\finder */ protected $finder; - public function setUp() + public function setUp(): void { $this->extension_manager = new phpbb_mock_extension_manager( dirname(__FILE__) . '/', diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php index f619d4c19d..231af81a39 100644 --- a/tests/extension/manager_test.php +++ b/tests/extension/manager_test.php @@ -26,7 +26,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/extensions.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php index 39b0576df6..a2f0542979 100644 --- a/tests/extension/metadata_manager_test.php +++ b/tests/extension/metadata_manager_test.php @@ -32,7 +32,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/extensions.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/extension/modules_test.php b/tests/extension/modules_test.php index 20b71e2812..f8c65bc147 100644 --- a/tests/extension/modules_test.php +++ b/tests/extension/modules_test.php @@ -24,7 +24,7 @@ class phpbb_extension_modules_test extends phpbb_test_case protected $finder; protected $module_manager; - public function setUp() + public function setUp(): void { global $phpbb_extension_manager; diff --git a/tests/feed/attachments_base_test.php b/tests/feed/attachments_base_test.php index 573218be42..e6864eff4f 100644 --- a/tests/feed/attachments_base_test.php +++ b/tests/feed/attachments_base_test.php @@ -25,7 +25,7 @@ class phpbb_feed_attachments_base_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/../extension/fixtures/extensions.xml'); } - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; @@ -99,7 +99,7 @@ class phpbb_feed_attachments_base_test extends phpbb_database_test_case if ($expected_exception !== false) { - $this->setExpectedException($expected_exception); + $this->expectException($expected_exception); $this->attachments_mocks_feed->get_sql(); } diff --git a/tests/files/types_base_test.php b/tests/files/types_base_test.php index 3b1cf68d50..a5533f2bc0 100644 --- a/tests/files/types_base_test.php +++ b/tests/files/types_base_test.php @@ -35,7 +35,7 @@ class phpbb_files_types_base_test extends phpbb_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx; diff --git a/tests/files/types_form_test.php b/tests/files/types_form_test.php index 25d79f6117..ffebcf603f 100644 --- a/tests/files/types_form_test.php +++ b/tests/files/types_form_test.php @@ -38,7 +38,7 @@ class phpbb_files_types_form_test extends phpbb_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx; diff --git a/tests/files/types_local_test.php b/tests/files/types_local_test.php index 67e4c571f5..7468e9c4a7 100644 --- a/tests/files/types_local_test.php +++ b/tests/files/types_local_test.php @@ -38,7 +38,7 @@ class phpbb_files_types_local_test extends phpbb_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx; diff --git a/tests/files/types_remote_test.php b/tests/files/types_remote_test.php index 85ec2a528b..d42a609fbb 100644 --- a/tests/files/types_remote_test.php +++ b/tests/files/types_remote_test.php @@ -40,7 +40,7 @@ class phpbb_files_types_remote_test extends phpbb_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - protected function setUp() + protected function setUp(): void { global $config, $phpbb_root_path, $phpEx; diff --git a/tests/files/upload_test.php b/tests/files/upload_test.php index a9c2dca9d9..c8857f863d 100644 --- a/tests/files/upload_test.php +++ b/tests/files/upload_test.php @@ -35,7 +35,7 @@ class phpbb_files_upload_test extends phpbb_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - protected function setUp() + protected function setUp(): void { // Global $config required by unique_id global $config, $phpbb_root_path, $phpEx; diff --git a/tests/filesystem/clean_path_test.php b/tests/filesystem/clean_path_test.php index d2dec424b4..dbb06e5e74 100644 --- a/tests/filesystem/clean_path_test.php +++ b/tests/filesystem/clean_path_test.php @@ -15,7 +15,7 @@ class phpbb_filesystem_clean_path_test extends phpbb_test_case { protected $filesystem; - public function setUp() + public function setUp(): void { parent::setUp(); $this->filesystem = new \phpbb\filesystem\filesystem(); diff --git a/tests/filesystem/is_absolute_test.php b/tests/filesystem/is_absolute_test.php index 7a50989b74..55e729feb7 100644 --- a/tests/filesystem/is_absolute_test.php +++ b/tests/filesystem/is_absolute_test.php @@ -16,7 +16,7 @@ class phpbb_filesystem_is_absolute_test extends phpbb_test_case /** @var \phpbb\filesystem\filesystem_interface */ protected $filesystem; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/filesystem/realpath_test.php b/tests/filesystem/realpath_test.php index d994935f94..3d05cd7ff2 100644 --- a/tests/filesystem/realpath_test.php +++ b/tests/filesystem/realpath_test.php @@ -27,7 +27,7 @@ class phpbb_filesystem_realpath_test extends phpbb_test_case self::$filesystem_own_realpath->setAccessible(true); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/functional/acp_permissions_test.php b/tests/functional/acp_permissions_test.php index 0a40e76057..ccaa4aab29 100644 --- a/tests/functional/acp_permissions_test.php +++ b/tests/functional/acp_permissions_test.php @@ -16,7 +16,7 @@ */ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/functional/acp_profile_field_test.php b/tests/functional/acp_profile_field_test.php index 7a0a6ca941..4c0414f03a 100644 --- a/tests/functional/acp_profile_field_test.php +++ b/tests/functional/acp_profile_field_test.php @@ -16,7 +16,7 @@ */ class phpbb_functional_acp_profile_field_test extends phpbb_functional_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/functional/acp_users_test.php b/tests/functional/acp_users_test.php index 78028aacb8..c8d0072c28 100644 --- a/tests/functional/acp_users_test.php +++ b/tests/functional/acp_users_test.php @@ -16,7 +16,7 @@ */ class phpbb_functional_acp_users_test extends phpbb_functional_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/functional/common_avatar_test_case.php b/tests/functional/common_avatar_test_case.php index 924eb1273c..155f6e0c09 100644 --- a/tests/functional/common_avatar_test_case.php +++ b/tests/functional/common_avatar_test_case.php @@ -21,7 +21,7 @@ abstract class phpbb_functional_common_avatar_test_case extends phpbb_functional abstract function get_url(); - public function setUp() + public function setUp(): void { parent::setUp(); $this->path = __DIR__ . '/fixtures/files/'; diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index a8d5ace4cf..b398a73e3f 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -37,7 +37,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case self::$helper->restore_original_ext_dir(); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php index 2957749e89..c5ebf761c9 100644 --- a/tests/functional/extension_controller_test.php +++ b/tests/functional/extension_controller_test.php @@ -45,7 +45,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c self::$helper->restore_original_ext_dir(); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/functional/extension_global_lang_test.php b/tests/functional/extension_global_lang_test.php index a1e2547745..94c80a6d9a 100644 --- a/tests/functional/extension_global_lang_test.php +++ b/tests/functional/extension_global_lang_test.php @@ -41,10 +41,10 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_ self::$helper->restore_original_ext_dir(); } - public function setUp() + public function setUp(): void { parent::setUp(); - + $this->get_db(); $this->phpbb_extension_manager = $this->get_extension_manager(); @@ -52,7 +52,7 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_ $this->purge_cache(); } - public function tearDown() + public function tearDown(): void { parent::tearDown(); diff --git a/tests/functional/extension_module_test.php b/tests/functional/extension_module_test.php index d3a66b9b35..09d0124990 100644 --- a/tests/functional/extension_module_test.php +++ b/tests/functional/extension_module_test.php @@ -40,7 +40,7 @@ class phpbb_functional_extension_module_test extends phpbb_functional_test_case self::$helper->restore_original_ext_dir(); } - public function setUp() + public function setUp(): void { global $db; diff --git a/tests/functional/extension_permission_lang_test.php b/tests/functional/extension_permission_lang_test.php index f570d45215..e0721ad1ec 100644 --- a/tests/functional/extension_permission_lang_test.php +++ b/tests/functional/extension_permission_lang_test.php @@ -41,12 +41,12 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t self::$helper->restore_original_ext_dir(); } - public function setUp() + public function setUp(): void { parent::setUp(); - + $this->get_db(); - + $acl_ary = array( 'auth_option' => 'u_foo', 'is_global' => 1, diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php index 3792b0a23c..a3cdfb336d 100644 --- a/tests/functional/feed_test.php +++ b/tests/functional/feed_test.php @@ -20,7 +20,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case static public $init_values = array(); - public function setUp() + public function setUp(): void { parent::setUp(); $this->purge_cache(); diff --git a/tests/functional/fileupload_form_test.php b/tests/functional/fileupload_form_test.php index b0780172ff..b0838344de 100644 --- a/tests/functional/fileupload_form_test.php +++ b/tests/functional/fileupload_form_test.php @@ -18,14 +18,14 @@ class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case { private $path; - public function setUp() + public function setUp(): void { parent::setUp(); $this->path = __DIR__ . '/fixtures/files/'; $this->add_lang('posting'); } - public function tearDown() + public function tearDown(): void { $iterator = new DirectoryIterator(__DIR__ . '/../../phpBB/files/'); foreach ($iterator as $fileinfo) diff --git a/tests/functional/fileupload_remote_test.php b/tests/functional/fileupload_remote_test.php index 4fced5700a..25fc9f0508 100644 --- a/tests/functional/fileupload_remote_test.php +++ b/tests/functional/fileupload_remote_test.php @@ -34,7 +34,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - public function setUp() + public function setUp(): void { parent::setUp(); // Only doing this within the functional framework because we need a @@ -65,7 +65,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case $this->phpbb_root_path = $phpbb_root_path; } - public function tearDown() + public function tearDown(): void { global $config, $user; $user = null; diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php index 64fa19557f..2fd5b45f7d 100644 --- a/tests/functional/forgot_password_test.php +++ b/tests/functional/forgot_password_test.php @@ -45,7 +45,7 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case } - public function tearDown() + public function tearDown(): void { $this->login(); $this->admin_login(); diff --git a/tests/functional/metadata_manager_test.php b/tests/functional/metadata_manager_test.php index 8456c40f00..4f4fad4434 100644 --- a/tests/functional/metadata_manager_test.php +++ b/tests/functional/metadata_manager_test.php @@ -24,7 +24,7 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case 'foo/bar/', ); - public function tearDown() + public function tearDown(): void { $this->purge_cache(); @@ -46,7 +46,7 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case self::$helper->restore_original_ext_dir(); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/functional/plupload_test.php b/tests/functional/plupload_test.php index 9d284a7e57..c3b2e5b9eb 100644 --- a/tests/functional/plupload_test.php +++ b/tests/functional/plupload_test.php @@ -30,7 +30,7 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case $db->sql_query($query); } - public function setUp() + public function setUp(): void { parent::setUp(); $this->purge_cache(); @@ -40,7 +40,7 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case $this->login(); } - public function tearDown() + public function tearDown(): void { $this->set_extension_group_permission(0); $iterator = new DirectoryIterator(__DIR__ . '/../../phpBB/files/'); diff --git a/tests/functional/ucp_pm_test.php b/tests/functional/ucp_pm_test.php index ddd5c8d791..53de247202 100644 --- a/tests/functional/ucp_pm_test.php +++ b/tests/functional/ucp_pm_test.php @@ -16,7 +16,7 @@ */ class phpbb_functional_ucp_pm_test extends phpbb_functional_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); $this->login(); diff --git a/tests/functions/build_url_test.php b/tests/functions/build_url_test.php index a528cec5ae..1519549d3e 100644 --- a/tests/functions/build_url_test.php +++ b/tests/functions/build_url_test.php @@ -13,7 +13,7 @@ class phpbb_build_url_test extends phpbb_test_case { - protected function setUp() + protected function setUp(): void { global $user, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path, $phpbb_path_helper; diff --git a/tests/functions/generate_string_list.php b/tests/functions/generate_string_list.php index 6eddb1395e..0f9975bcac 100644 --- a/tests/functions/generate_string_list.php +++ b/tests/functions/generate_string_list.php @@ -15,7 +15,7 @@ class phpbb_generate_string_list_test extends phpbb_test_case { public $user; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/functions/make_clickable_email_test.php b/tests/functions/make_clickable_email_test.php index d481bde80d..18ad789705 100644 --- a/tests/functions/make_clickable_email_test.php +++ b/tests/functions/make_clickable_email_test.php @@ -13,7 +13,7 @@ class phpbb_functions_make_clickable_email_test extends phpbb_test_case { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/make_clickable_test.php b/tests/functions/make_clickable_test.php index a6af12b624..d8d5eb5e0e 100644 --- a/tests/functions/make_clickable_test.php +++ b/tests/functions/make_clickable_test.php @@ -154,7 +154,7 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case ); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/obtain_online_test.php b/tests/functions/obtain_online_test.php index 77b1079802..f740decab8 100644 --- a/tests/functions/obtain_online_test.php +++ b/tests/functions/obtain_online_test.php @@ -18,7 +18,7 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/obtain_online.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/phpbb_get_banned_user_ids.php b/tests/functions/phpbb_get_banned_user_ids.php index 6f7607132e..e1cb7a4636 100644 --- a/tests/functions/phpbb_get_banned_user_ids.php +++ b/tests/functions/phpbb_get_banned_user_ids.php @@ -43,13 +43,13 @@ class phpbb_get_banned_user_ids_test extends phpbb_database_test_case ); } - public function setUp() + public function setUp(): void { global $db; $db = $this->new_dbal(); - return parent::setUp(); + parent::setUp(); } /** diff --git a/tests/functions/user_delete_test.php b/tests/functions/user_delete_test.php index f419c90e9e..89aecdefb9 100644 --- a/tests/functions/user_delete_test.php +++ b/tests/functions/user_delete_test.php @@ -23,7 +23,7 @@ class phpbb_functions_user_delete_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/user_delete.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_date_test.php b/tests/functions/validate_date_test.php index 9dc0db46d6..cd4e7430f3 100644 --- a/tests/functions/validate_date_test.php +++ b/tests/functions/validate_date_test.php @@ -18,7 +18,7 @@ class phpbb_functions_validate_date_test extends phpbb_test_case { protected $helper; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_email_test.php b/tests/functions/validate_email_test.php index 7f8b2679d4..e163d01412 100644 --- a/tests/functions/validate_email_test.php +++ b/tests/functions/validate_email_test.php @@ -22,7 +22,7 @@ class phpbb_functions_validate_email_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/validate_email.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_jabber_test.php b/tests/functions/validate_jabber_test.php index 23811a94c0..dbdf10cb4a 100644 --- a/tests/functions/validate_jabber_test.php +++ b/tests/functions/validate_jabber_test.php @@ -18,7 +18,7 @@ class phpbb_functions_validate_jabber_test extends phpbb_test_case { protected $helper; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -32,7 +32,7 @@ class phpbb_functions_validate_jabber_test extends phpbb_test_case array(), '', array('jabber'), - ), + ), 'no_seperator' => array( array('WRONG_DATA'), 'testjabber.ccc', diff --git a/tests/functions/validate_lang_iso_test.php b/tests/functions/validate_lang_iso_test.php index 81b56055e6..cbe5339ea5 100644 --- a/tests/functions/validate_lang_iso_test.php +++ b/tests/functions/validate_lang_iso_test.php @@ -24,7 +24,7 @@ class phpbb_functions_validate_lang_iso_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/language_select.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_match_test.php b/tests/functions/validate_match_test.php index 811bed3e33..7159686066 100644 --- a/tests/functions/validate_match_test.php +++ b/tests/functions/validate_match_test.php @@ -18,7 +18,7 @@ class phpbb_functions_validate_match_test extends phpbb_test_case { protected $helper; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_num_test.php b/tests/functions/validate_num_test.php index 798468759c..acbdc49614 100644 --- a/tests/functions/validate_num_test.php +++ b/tests/functions/validate_num_test.php @@ -18,7 +18,7 @@ class phpbb_functions_validate_num_test extends phpbb_test_case { protected $helper; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_password_test.php b/tests/functions/validate_password_test.php index 5e34c8baba..6e4ccea3ab 100644 --- a/tests/functions/validate_password_test.php +++ b/tests/functions/validate_password_test.php @@ -18,7 +18,7 @@ class phpbb_functions_validate_password_test extends phpbb_test_case { protected $helper; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_string_test.php b/tests/functions/validate_string_test.php index 7aca14c334..83ba546152 100644 --- a/tests/functions/validate_string_test.php +++ b/tests/functions/validate_string_test.php @@ -18,7 +18,7 @@ class phpbb_functions_validate_string_test extends phpbb_test_case { protected $helper; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_user_email_test.php b/tests/functions/validate_user_email_test.php index 8dcec88103..a05a7808a4 100644 --- a/tests/functions/validate_user_email_test.php +++ b/tests/functions/validate_user_email_test.php @@ -26,7 +26,7 @@ class phpbb_functions_validate_user_email_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/validate_email.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_username_test.php b/tests/functions/validate_username_test.php index cee5d38400..3a4b63b5e8 100644 --- a/tests/functions/validate_username_test.php +++ b/tests/functions/validate_username_test.php @@ -26,7 +26,7 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/validate_username.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions/validate_with_method_test.php b/tests/functions/validate_with_method_test.php index 37e05d412a..1cd610fd2f 100644 --- a/tests/functions/validate_with_method_test.php +++ b/tests/functions/validate_with_method_test.php @@ -18,7 +18,7 @@ class phpbb_functions_validate_with_method_test extends phpbb_test_case { protected $helper; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions_acp/build_select_test.php b/tests/functions_acp/build_select_test.php index ebdc58fd64..9a295762c3 100644 --- a/tests/functions_acp/build_select_test.php +++ b/tests/functions_acp/build_select_test.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_built_select_test extends phpbb_test_case { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions_acp/h_radio_test.php b/tests/functions_acp/h_radio_test.php index 5ae4e91ea2..cc9d837357 100644 --- a/tests/functions_acp/h_radio_test.php +++ b/tests/functions_acp/h_radio_test.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_h_radio_test extends phpbb_test_case { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions_acp/validate_config_vars_test.php b/tests/functions_acp/validate_config_vars_test.php index 3bd2204de9..0198f28a39 100644 --- a/tests/functions_acp/validate_config_vars_test.php +++ b/tests/functions_acp/validate_config_vars_test.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_validate_config_vars_test extends phpbb_test_case { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions_acp/validate_range_test.php b/tests/functions_acp/validate_range_test.php index 9e9154a43c..085787105f 100644 --- a/tests/functions_acp/validate_range_test.php +++ b/tests/functions_acp/validate_range_test.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_validate_range_test extends phpbb_test_case { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions_content/phpbb_format_quote_test.php b/tests/functions_content/phpbb_format_quote_test.php index cbbd46d0a9..52a792517a 100644 --- a/tests/functions_content/phpbb_format_quote_test.php +++ b/tests/functions_content/phpbb_format_quote_test.php @@ -18,7 +18,7 @@ class phpbb_functions_content_phpbb_format_quote_test extends phpbb_test_case /** @var \phpbb\language\language */ protected $lang; - public function setUp() + public function setUp(): void { global $cache, $user, $phpbb_root_path, $phpEx; diff --git a/tests/functions_privmsgs/get_max_setting_from_group_test.php b/tests/functions_privmsgs/get_max_setting_from_group_test.php index fbabf1222a..b96f490c88 100644 --- a/tests/functions_privmsgs/get_max_setting_from_group_test.php +++ b/tests/functions_privmsgs/get_max_setting_from_group_test.php @@ -23,7 +23,7 @@ class phpbb_functions_privmsgs_get_max_setting_from_group_test extends phpbb_dat /** @var \phpbb\db\driver\driver_interface */ protected $db; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/functions_user/delete_user_test.php b/tests/functions_user/delete_user_test.php index 09ed51890c..c112a0c368 100644 --- a/tests/functions_user/delete_user_test.php +++ b/tests/functions_user/delete_user_test.php @@ -19,7 +19,7 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/delete_user.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/group/helper_test.php b/tests/group/helper_test.php index 2377a6f47c..855663791b 100644 --- a/tests/group/helper_test.php +++ b/tests/group/helper_test.php @@ -16,7 +16,7 @@ class phpbb_group_helper_test extends phpbb_test_case /** @var \phpbb\group\helper */ protected $group_helper; - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; diff --git a/tests/groupposition/legend_test.php b/tests/groupposition/legend_test.php index 02ddb7cbce..66fc909770 100644 --- a/tests/groupposition/legend_test.php +++ b/tests/groupposition/legend_test.php @@ -43,7 +43,7 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case if ($throws_exception) { - $this->setExpectedException($throws_exception); + $this->expectException($throws_exception); } $test_class = new \phpbb\groupposition\legend($db, $user); diff --git a/tests/groupposition/teampage_test.php b/tests/groupposition/teampage_test.php index 3b916670f7..8598e5cfb0 100644 --- a/tests/groupposition/teampage_test.php +++ b/tests/groupposition/teampage_test.php @@ -43,7 +43,7 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case if ($throws_exception) { - $this->setExpectedException($throws_exception); + $this->expectException($throws_exception); } $test_class = new \phpbb\groupposition\teampage($db, $user, $cache); diff --git a/tests/help/manager_test.php b/tests/help/manager_test.php index 68534d9a32..118a38ad3e 100644 --- a/tests/help/manager_test.php +++ b/tests/help/manager_test.php @@ -20,7 +20,7 @@ class phpbb_help_manager_test extends phpbb_test_case /** @var \phpbb\language\language */ protected $language; - public function setUp() + public function setUp(): void { $this->template = $this->getMockBuilder('\phpbb\template\template') ->disableOriginalConstructor() diff --git a/tests/installer/database_helper_test.php b/tests/installer/database_helper_test.php index ed355884f6..9ffdad3e03 100644 --- a/tests/installer/database_helper_test.php +++ b/tests/installer/database_helper_test.php @@ -18,7 +18,7 @@ class phpbb_installer_database_helper_test extends phpbb_test_case */ private $database_helper; - public function setUp() + public function setUp(): void { $filesystem = new \phpbb\filesystem\filesystem(); $phpbb_root_path = ''; diff --git a/tests/installer/installer_config_test.php b/tests/installer/installer_config_test.php index 1193d7aee4..6fa8248b68 100644 --- a/tests/installer/installer_config_test.php +++ b/tests/installer/installer_config_test.php @@ -20,7 +20,7 @@ class phpbb_installer_config_test extends phpbb_test_case */ private $config; - public function setUp() + public function setUp(): void { $phpbb_root_path = __DIR__ . './../../phpBB/'; $filesystem = $this->createMock('\phpbb\filesystem\filesystem'); diff --git a/tests/installer/module_base_test.php b/tests/installer/module_base_test.php index 71ec2b8db2..887d29f4c6 100644 --- a/tests/installer/module_base_test.php +++ b/tests/installer/module_base_test.php @@ -26,7 +26,7 @@ class module_base_test extends phpbb_test_case */ protected $container; - public function setUp() + public function setUp(): void { // DI container mock $this->container = new phpbb_mock_container_builder(); diff --git a/tests/language/language_test.php b/tests/language/language_test.php index 29b4873dcb..8b822472cd 100644 --- a/tests/language/language_test.php +++ b/tests/language/language_test.php @@ -16,7 +16,7 @@ class phpbb_language_test extends phpbb_test_case /** @var \phpbb\language\language */ protected $lang; - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; diff --git a/tests/lock/db_test.php b/tests/lock/db_test.php index 5fbfa26554..e96920ed1f 100644 --- a/tests/lock/db_test.php +++ b/tests/lock/db_test.php @@ -22,7 +22,7 @@ class phpbb_lock_db_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml'); } - public function setUp() + public function setUp(): void { global $db, $config; diff --git a/tests/log/delete_test.php b/tests/log/delete_test.php index 04aa20d9ce..503e2c2fca 100644 --- a/tests/log/delete_test.php +++ b/tests/log/delete_test.php @@ -20,7 +20,7 @@ class phpbb_log_delete_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/delete_log.xml'); } - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx, $db, $phpbb_dispatcher, $auth; diff --git a/tests/mcp/post_ip_test.php b/tests/mcp/post_ip_test.php index 72a9f62774..f53066c9e6 100644 --- a/tests/mcp/post_ip_test.php +++ b/tests/mcp/post_ip_test.php @@ -23,7 +23,7 @@ class phpbb_mcp_post_ip_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/post_ip.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/migrator/convert_timezones_test.php b/tests/migrator/convert_timezones_test.php index f8d780da0c..4bb0aec34f 100644 --- a/tests/migrator/convert_timezones_test.php +++ b/tests/migrator/convert_timezones_test.php @@ -49,7 +49,7 @@ class phpbb_migrator_convert_timezones_test extends phpbb_database_test_case ); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/migrator/get_callable_from_step_test.php b/tests/migrator/get_callable_from_step_test.php index af636f5d21..f08caf3181 100644 --- a/tests/migrator/get_callable_from_step_test.php +++ b/tests/migrator/get_callable_from_step_test.php @@ -13,7 +13,7 @@ class get_callable_from_step_test extends phpbb_database_test_case { - public function setUp() + public function setUp(): void { global $phpbb_root_path, $php_ext, $table_prefix, $phpbb_log; diff --git a/tests/migrator/get_schema_steps_test.php b/tests/migrator/get_schema_steps_test.php index 3d15d2b200..10accb3d68 100644 --- a/tests/migrator/get_schema_steps_test.php +++ b/tests/migrator/get_schema_steps_test.php @@ -13,7 +13,7 @@ class get_schema_steps_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/migrator/reverse_update_data_test.php b/tests/migrator/reverse_update_data_test.php index b85e48c64c..b93680c2e2 100644 --- a/tests/migrator/reverse_update_data_test.php +++ b/tests/migrator/reverse_update_data_test.php @@ -16,7 +16,7 @@ class reverse_update_data_test extends phpbb_test_case /** @var \phpbb\db\migration\helper */ protected $helper; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/migrator/schema_generator_test.php b/tests/migrator/schema_generator_test.php index 1996d207ea..88257430a7 100644 --- a/tests/migrator/schema_generator_test.php +++ b/tests/migrator/schema_generator_test.php @@ -24,7 +24,7 @@ class schema_generator_test extends phpbb_test_case /** @var \phpbb\db\migration\schema_generator */ protected $generator; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/mimetype/guesser_test.php b/tests/mimetype/guesser_test.php index fa53e6c8c4..238e7ae2d6 100644 --- a/tests/mimetype/guesser_test.php +++ b/tests/mimetype/guesser_test.php @@ -27,7 +27,7 @@ class guesser_test extends \phpbb_test_case protected $fileinfo_supported = false; - public function setUp() + public function setUp(): void { global $phpbb_root_path; @@ -181,7 +181,7 @@ class guesser_test extends \phpbb_test_case if (!$supported) { - $this->setExpectedException('\LogicException'); + $this->expectException('\LogicException'); } $guesser = new \phpbb\mimetype\guesser($guessers); diff --git a/tests/mock/cache.php b/tests/mock/cache.php index 5fa3d28147..2306fd9009 100644 --- a/tests/mock/cache.php +++ b/tests/mock/cache.php @@ -72,13 +72,13 @@ class phpbb_mock_cache implements \phpbb\cache\driver\driver_interface } } - public function checkVar(PHPUnit_Framework_Assert $test, $var_name, $data) + public function checkVar(PHPUnit\Framework\Assert $test, $var_name, $data) { $test->assertTrue(isset($this->data[$var_name])); $test->assertEquals($data, $this->data[$var_name]); } - public function checkAssociativeVar(PHPUnit_Framework_Assert $test, $var_name, $data, $sort = true) + public function checkAssociativeVar(PHPUnit\Framework\Assert $test, $var_name, $data, $sort = true) { $test->assertTrue(isset($this->data[$var_name])); @@ -93,12 +93,12 @@ class phpbb_mock_cache implements \phpbb\cache\driver\driver_interface $test->assertEquals($data, $this->data[$var_name]); } - public function checkVarUnset(PHPUnit_Framework_Assert $test, $var_name) + public function checkVarUnset(PHPUnit\Framework\Assert $test, $var_name) { $test->assertFalse(isset($this->data[$var_name])); } - public function check(PHPUnit_Framework_Assert $test, $data, $ignore_db_info = true) + public function check(PHPUnit\Framework\Assert $test, $data, $ignore_db_info = true) { $cache_data = $this->data; diff --git a/tests/mock/session_testable.php b/tests/mock/session_testable.php index 5a57eecf61..7828a864d4 100644 --- a/tests/mock/session_testable.php +++ b/tests/mock/session_testable.php @@ -30,14 +30,14 @@ class phpbb_mock_session_testable extends \phpbb\session /** * Checks if the cookies were set correctly. * - * @param PHPUnit_Framework_Assert test The test from which this is called + * @param PHPUnit\Framework\Assert test The test from which this is called * @param array(string => mixed) cookies The cookie data to check against. * The keys are cookie names, the values can either be null to * check only the existence of the cookie, or an array(d, t), * where d is the cookie data to check, or null to skip the * check and t is the cookie time to check, or null to skip. */ - public function check_cookies(PHPUnit_Framework_Assert $test, $cookies) + public function check_cookies(PHPUnit\Framework\Assert $test, $cookies) { $test->assertEquals(array_keys($cookies), array_keys($this->_cookies), 'Incorrect cookies were set'); diff --git a/tests/notification/base.php b/tests/notification/base.php index 80b9a0d777..f7faf50d68 100644 --- a/tests/notification/base.php +++ b/tests/notification/base.php @@ -50,7 +50,7 @@ abstract class phpbb_tests_notification_base extends phpbb_database_test_case ); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/notification/convert_test.php b/tests/notification/convert_test.php index 4a7fd89409..d4a33ff537 100644 --- a/tests/notification/convert_test.php +++ b/tests/notification/convert_test.php @@ -21,7 +21,7 @@ class phpbb_notification_convert_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/convert.xml'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/notification/submit_post_base.php b/tests/notification/submit_post_base.php index baa90f29b1..466d3ec07f 100644 --- a/tests/notification/submit_post_base.php +++ b/tests/notification/submit_post_base.php @@ -47,7 +47,7 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/submit_post_' . $this->item_type . '.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/notification/submit_post_type_bookmark_test.php b/tests/notification/submit_post_type_bookmark_test.php index 7c3b9f938f..9af247b3c3 100644 --- a/tests/notification/submit_post_type_bookmark_test.php +++ b/tests/notification/submit_post_type_bookmark_test.php @@ -17,7 +17,7 @@ class phpbb_notification_submit_post_type_bookmark_test extends phpbb_notificati { protected $item_type = 'notification.type.bookmark'; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/notification/submit_post_type_post_in_queue_test.php b/tests/notification/submit_post_type_post_in_queue_test.php index 1390e92d96..bced0ea48c 100644 --- a/tests/notification/submit_post_type_post_in_queue_test.php +++ b/tests/notification/submit_post_type_post_in_queue_test.php @@ -17,7 +17,7 @@ class phpbb_notification_submit_post_type_post_in_queue_test extends phpbb_notif { protected $item_type = 'notification.type.post_in_queue'; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/notification/submit_post_type_post_test.php b/tests/notification/submit_post_type_post_test.php index 037c326bc0..5580d0924e 100644 --- a/tests/notification/submit_post_type_post_test.php +++ b/tests/notification/submit_post_type_post_test.php @@ -17,7 +17,7 @@ class phpbb_notification_submit_post_type_post_test extends phpbb_notification_s { protected $item_type = 'notification.type.post'; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/notification/submit_post_type_quote_test.php b/tests/notification/submit_post_type_quote_test.php index 3fab8c05ba..655f12661b 100644 --- a/tests/notification/submit_post_type_quote_test.php +++ b/tests/notification/submit_post_type_quote_test.php @@ -17,7 +17,7 @@ class phpbb_notification_submit_post_type_quote_test extends phpbb_notification_ { protected $item_type = 'notification.type.quote'; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/notification/submit_post_type_topic_test.php b/tests/notification/submit_post_type_topic_test.php index a51f0780b1..070b2fa21e 100644 --- a/tests/notification/submit_post_type_topic_test.php +++ b/tests/notification/submit_post_type_topic_test.php @@ -17,7 +17,7 @@ class phpbb_notification_submit_post_type_topic_test extends phpbb_notification_ { protected $item_type = 'notification.type.topic'; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/notification/user_list_trim_test.php b/tests/notification/user_list_trim_test.php index 0de6294491..bf3058c342 100644 --- a/tests/notification/user_list_trim_test.php +++ b/tests/notification/user_list_trim_test.php @@ -20,7 +20,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/user_list_trim.xml'); } - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx, $phpbb_dispatcher, $user, $cache, $auth; diff --git a/tests/pagination/pagination_test.php b/tests/pagination/pagination_test.php index b3588e0655..073ba1d5cd 100644 --- a/tests/pagination/pagination_test.php +++ b/tests/pagination/pagination_test.php @@ -22,7 +22,7 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case return implode('-', func_get_args()); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/passwords/drivers_test.php b/tests/passwords/drivers_test.php index 300c093f12..547ee33f2e 100644 --- a/tests/passwords/drivers_test.php +++ b/tests/passwords/drivers_test.php @@ -13,7 +13,7 @@ class phpbb_passwords_helper_test extends \phpbb_test_case { - public function setUp() + public function setUp(): void { // Prepare dependencies for drivers $config = new \phpbb\config\config(array()); diff --git a/tests/passwords/manager_test.php b/tests/passwords/manager_test.php index 40e2849f9c..dc5c539316 100644 --- a/tests/passwords/manager_test.php +++ b/tests/passwords/manager_test.php @@ -19,7 +19,7 @@ class phpbb_passwords_manager_test extends \phpbb_test_case protected $default_pw = 'foobar'; - public function setUp() + public function setUp(): void { // Prepare dependencies for manager and driver $config = new \phpbb\config\config(array()); diff --git a/tests/path_helper/path_helper_test.php b/tests/path_helper/path_helper_test.php index 585d62847e..447ed7a2db 100644 --- a/tests/path_helper/path_helper_test.php +++ b/tests/path_helper/path_helper_test.php @@ -17,7 +17,7 @@ class phpbb_path_helper_test extends phpbb_test_case protected $path_helper; protected $phpbb_root_path = ''; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/profilefields/type_bool_test.php b/tests/profilefields/type_bool_test.php index 66e1578e8a..3e7cace288 100644 --- a/tests/profilefields/type_bool_test.php +++ b/tests/profilefields/type_bool_test.php @@ -23,7 +23,7 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case * @access public * @return void */ - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; diff --git a/tests/profilefields/type_date_test.php b/tests/profilefields/type_date_test.php index dc547c2d10..b70aa60368 100644 --- a/tests/profilefields/type_date_test.php +++ b/tests/profilefields/type_date_test.php @@ -23,7 +23,7 @@ class phpbb_profilefield_type_date_test extends phpbb_test_case * @access public * @return null */ - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; diff --git a/tests/profilefields/type_dropdown_test.php b/tests/profilefields/type_dropdown_test.php index 96b2ad31be..738801d524 100644 --- a/tests/profilefields/type_dropdown_test.php +++ b/tests/profilefields/type_dropdown_test.php @@ -23,7 +23,7 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case * @access public * @return null */ - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; diff --git a/tests/profilefields/type_googleplus_test.php b/tests/profilefields/type_googleplus_test.php index 06ba231e68..a5f934ea17 100644 --- a/tests/profilefields/type_googleplus_test.php +++ b/tests/profilefields/type_googleplus_test.php @@ -15,7 +15,7 @@ class phpbb_profilefield_type_googleplus_test extends phpbb_test_case { protected $field; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/profilefields/type_int_test.php b/tests/profilefields/type_int_test.php index 326c6051b3..943f130835 100644 --- a/tests/profilefields/type_int_test.php +++ b/tests/profilefields/type_int_test.php @@ -22,7 +22,7 @@ class phpbb_profilefield_type_int_test extends phpbb_test_case * @access public * @return null */ - public function setUp() + public function setUp(): void { global $phpbb_root_path, $phpEx; diff --git a/tests/profilefields/type_string_test.php b/tests/profilefields/type_string_test.php index 946e513e96..19bfbbc926 100644 --- a/tests/profilefields/type_string_test.php +++ b/tests/profilefields/type_string_test.php @@ -22,7 +22,7 @@ class phpbb_profilefield_type_string_test extends phpbb_test_case * @access public * @return null */ - public function setUp() + public function setUp(): void { global $config, $request, $user, $cache, $phpbb_root_path, $phpEx; diff --git a/tests/profilefields/type_url_test.php b/tests/profilefields/type_url_test.php index 18aa214e3d..5ed5fb4c2f 100644 --- a/tests/profilefields/type_url_test.php +++ b/tests/profilefields/type_url_test.php @@ -26,7 +26,7 @@ class phpbb_profilefield_type_url_test extends phpbb_test_case * @access public * @return null */ - public function setUp() + public function setUp(): void { global $config, $request, $user, $cache, $phpbb_root_path, $phpEx; diff --git a/tests/random/gen_rand_string_test.php b/tests/random/gen_rand_string_test.php index 428db6ac98..044fd3cc15 100644 --- a/tests/random/gen_rand_string_test.php +++ b/tests/random/gen_rand_string_test.php @@ -17,7 +17,7 @@ class phpbb_random_gen_rand_string_test extends phpbb_test_case const MIN_STRING_LENGTH = 1; const MAX_STRING_LENGTH = 15; - public function setUp() + public function setUp(): void { global $config; diff --git a/tests/regex/email_test.php b/tests/regex/email_test.php index 5187b8bda6..7b10b0a6ef 100644 --- a/tests/regex/email_test.php +++ b/tests/regex/email_test.php @@ -15,7 +15,7 @@ class phpbb_regex_email_test extends phpbb_test_case { protected $regex; - public function setUp() + public function setUp(): void { $this->regex = '#^' . get_preg_expression('email') . '$#i'; } @@ -36,7 +36,7 @@ class phpbb_regex_email_test extends phpbb_test_case //array('"John Doe"@example.com'), //array('Alice@[192.168.2.1]'), // IPv4 //array('Bob@[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]'), // IPv6 - + // http://fightingforalostcause.net/misc/2006/compare-email-regex.php array('l3tt3rsAndNumb3rs@domain.com'), array('has-dash@domain.com'), @@ -80,7 +80,7 @@ class phpbb_regex_email_test extends phpbb_test_case array('abc,def@example.com'), // invalid character , array('abc<def@example.com'), // invalid character < array('abc>def@example.com'), // invalid character > - + // http://fightingforalostcause.net/misc/2006/compare-email-regex.php array('missingDomain@.com'), array('@missingLocal.org'), diff --git a/tests/regex/ipv4_test.php b/tests/regex/ipv4_test.php index e21a2d77fa..5d859c240b 100644 --- a/tests/regex/ipv4_test.php +++ b/tests/regex/ipv4_test.php @@ -15,7 +15,7 @@ class phpbb_regex_ipv4_test extends phpbb_test_case { protected $regex; - public function setUp() + public function setUp(): void { $this->regex = get_preg_expression('ipv4'); } diff --git a/tests/regex/ipv6_test.php b/tests/regex/ipv6_test.php index 223161df7f..d4a86015ae 100644 --- a/tests/regex/ipv6_test.php +++ b/tests/regex/ipv6_test.php @@ -15,7 +15,7 @@ class phpbb_regex_ipv6_test extends phpbb_test_case { protected $regex; - public function setUp() + public function setUp(): void { $this->regex = get_preg_expression('ipv6'); } diff --git a/tests/request/request_test.php b/tests/request/request_test.php index 47798177e1..d03253ceb9 100644 --- a/tests/request/request_test.php +++ b/tests/request/request_test.php @@ -19,7 +19,7 @@ class phpbb_request_test extends phpbb_test_case /** @var \phpbb\request\request */ private $request; - protected function setUp() + protected function setUp(): void { // populate super globals $_POST['test'] = 1; @@ -264,7 +264,7 @@ class phpbb_request_test extends phpbb_test_case /** * Makes sure super globals work properly after these tests */ - protected function tearDown() + protected function tearDown(): void { $this->request->enable_super_globals(); } diff --git a/tests/request/request_var_test.php b/tests/request/request_var_test.php index 84c81c4e84..8dc8e4c7c7 100644 --- a/tests/request/request_var_test.php +++ b/tests/request/request_var_test.php @@ -16,7 +16,7 @@ class phpbb_request_var_test extends phpbb_test_case /** * Makes sure request_var has its standard behaviour. */ - protected function setUp() + protected function setUp(): void { parent::setUp(); request_var(false, false, false, false, false); diff --git a/tests/request/type_cast_helper_test.php b/tests/request/type_cast_helper_test.php index 6407dca894..5810c67b78 100644 --- a/tests/request/type_cast_helper_test.php +++ b/tests/request/type_cast_helper_test.php @@ -15,7 +15,7 @@ class phpbb_type_cast_helper_test extends phpbb_test_case { private $type_cast_helper; - protected function setUp() + protected function setUp(): void { $this->type_cast_helper = new \phpbb\request\type_cast_helper(); } diff --git a/tests/search/mysql_test.php b/tests/search/mysql_test.php index 3a791f5e81..7d3917296e 100644 --- a/tests/search/mysql_test.php +++ b/tests/search/mysql_test.php @@ -23,7 +23,7 @@ class phpbb_search_mysql_test extends phpbb_search_common_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml'); } - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx, $config, $user, $cache; diff --git a/tests/search/native_test.php b/tests/search/native_test.php index 0e6f719cef..2e11eaff14 100644 --- a/tests/search/native_test.php +++ b/tests/search/native_test.php @@ -23,7 +23,7 @@ class phpbb_search_native_test extends phpbb_search_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/posts.xml'); } - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx, $config, $user, $cache; diff --git a/tests/search/postgres_test.php b/tests/search/postgres_test.php index 97cca0e70c..7e2a6cec85 100644 --- a/tests/search/postgres_test.php +++ b/tests/search/postgres_test.php @@ -23,7 +23,7 @@ class phpbb_search_postgres_test extends phpbb_search_common_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml'); } - protected function setUp() + protected function setUp(): void { global $phpbb_root_path, $phpEx, $config, $user, $cache; diff --git a/tests/security/base.php b/tests/security/base.php index d2abdbc362..ad518b5543 100644 --- a/tests/security/base.php +++ b/tests/security/base.php @@ -18,7 +18,7 @@ abstract class phpbb_security_test_base extends phpbb_test_case /** * Set up the required user object and server variables for the suites */ - protected function setUp() + protected function setUp(): void { global $user, $phpbb_root_path, $phpEx, $request, $symfony_request, $phpbb_filesystem; @@ -60,7 +60,7 @@ abstract class phpbb_security_test_base extends phpbb_test_case $user->page = \phpbb\session::extract_current_page($phpbb_root_path); } - protected function tearDown() + protected function tearDown(): void { global $user; $user = NULL; diff --git a/tests/security/hash_test.php b/tests/security/hash_test.php index 113c32bf7f..40d14f24bf 100644 --- a/tests/security/hash_test.php +++ b/tests/security/hash_test.php @@ -13,7 +13,7 @@ class phpbb_security_hash_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { global $phpbb_container; diff --git a/tests/security/redirect_test.php b/tests/security/redirect_test.php index 0d08eaeac1..313e329e20 100644 --- a/tests/security/redirect_test.php +++ b/tests/security/redirect_test.php @@ -75,7 +75,7 @@ class phpbb_security_redirect_test extends phpbb_security_test_base return $this->path_helper; } - protected function setUp() + protected function setUp(): void { global $phpbb_dispatcher; diff --git a/tests/session/check_ban_test.php b/tests/session/check_ban_test.php index 16a65b0ade..0ee655f4ac 100644 --- a/tests/session/check_ban_test.php +++ b/tests/session/check_ban_test.php @@ -17,6 +17,7 @@ class phpbb_session_check_ban_test extends phpbb_session_test_case { protected $user_id = 4; protected $key_id = 4; + /** @var \phpbb\session */ protected $session; protected $backup_cache; @@ -37,7 +38,7 @@ class phpbb_session_check_ban_test extends phpbb_session_test_case ); } - public function setUp() + public function setUp(): void { parent::setUp(); // Get session here so that config is mocked correctly @@ -59,7 +60,7 @@ class phpbb_session_check_ban_test extends phpbb_session_test_case ); } - public function tearDown() + public function tearDown(): void { parent::tearDown(); // Set cache back to what it was before the test changed it @@ -75,7 +76,7 @@ class phpbb_session_check_ban_test extends phpbb_session_test_case $ban = $this->session->check_ban($user_id, $user_ips, $user_email, $return); $is_banned = !empty($ban); } - catch (PHPUnit_Framework_Error_Notice $e) + catch (PHPUnit\Framework\Error\Notice $e) { // User error was triggered, user must have been banned $is_banned = true; diff --git a/tests/session/garbage_collection_test.php b/tests/session/garbage_collection_test.php index 3dc591a328..d361e022da 100644 --- a/tests/session/garbage_collection_test.php +++ b/tests/session/garbage_collection_test.php @@ -22,7 +22,7 @@ class phpbb_session_garbage_collection_test extends phpbb_session_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/sessions_garbage.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); $this->session = $this->session_factory->get_session($this->db); diff --git a/tests/session/testable_factory.php b/tests/session/testable_factory.php index 6f8b49122b..d381b4cbbd 100644 --- a/tests/session/testable_factory.php +++ b/tests/session/testable_factory.php @@ -120,10 +120,10 @@ class phpbb_session_testable_factory /** * Check if the cache used for the generated session contains correct data. * - * @param PHPUnit_Framework_Assert $test The test case to call assert methods + * @param PHPUnit\Framework\Assert $test The test case to call assert methods * on */ - public function check(PHPUnit_Framework_Assert $test) + public function check(PHPUnit\Framework\Assert $test) { $this->cache->check($test, $this->get_cache_data()); } diff --git a/tests/template/context_test.php b/tests/template/context_test.php index 52ce6c8fde..a1be672f51 100644 --- a/tests/template/context_test.php +++ b/tests/template/context_test.php @@ -14,7 +14,7 @@ class context_test extends phpbb_test_case { protected $context; - protected function setUp() + protected function setUp(): void { $this->context = new \phpbb\template\context(); @@ -31,7 +31,7 @@ class context_test extends phpbb_test_case 'SUBFOO' => 'subfoo' . $j, 'SUBBAR' => 'subbar' . $j, )); - + for ($k = 0; $k < 10; $k++) { $this->context->assign_block_vars('block' . $i . '.subblock.subsubblock', array( diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 727f35e9d2..01c132e032 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -521,7 +521,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case $this->template->set_filenames(array('test' => $filename)); $this->assertFileNotExists($this->template_path . '/' . $filename, 'Testing missing file, file cannot exist'); - $this->setExpectedException('Twig_Error_Loader'); + $this->expectException('Twig_Error_Loader'); $this->display('test'); } @@ -529,7 +529,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case public function test_invalid_handle() { - $this->setExpectedException('Twig_Error_Loader'); + $this->expectException('Twig_Error_Loader'); $this->display('test'); } diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php index 005d396a0e..0389088ec8 100644 --- a/tests/template/template_test_case.php +++ b/tests/template/template_test_case.php @@ -118,7 +118,7 @@ class phpbb_template_template_test_case extends phpbb_test_case $this->template->set_custom_style('tests', $this->template_path); } - protected function setUp() + protected function setUp(): void { // Test the engine can be used $this->setup_engine(); @@ -130,7 +130,7 @@ class phpbb_template_template_test_case extends phpbb_test_case $phpbb_filesystem = new \phpbb\filesystem\filesystem(); } - protected function tearDown() + protected function tearDown(): void { if ($this->template) { diff --git a/tests/template/templates/expressions.html b/tests/template/templates/expressions.html index e1283f165f..17a5b8d265 100644 --- a/tests/template/templates/expressions.html +++ b/tests/template/templates/expressions.html @@ -3,7 +3,7 @@ <!-- IF not 390 is even -->fail<!-- ELSE -->pass<!-- ENDIF --> <!-- IF 9 is odd -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF 32 is odd -->fail<!-- ELSE -->pass<!-- ENDIF --> -<!-- IF 32 is div by 16 -->pass<!-- ELSE -->fail<!-- ENDIF --> +<!-- IF 32 is divisible by(16) -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF 10 is not even -->fail<!-- ELSE -->pass<!-- ENDIF --> <!-- IF 24 == 24 -->pass<!-- ELSE -->fail<!-- ENDIF --> <!-- IF 24 eq 24 -->pass<!-- ELSE -->fail<!-- ENDIF --> diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php index 606c40a623..3ad1473990 100644 --- a/tests/test_framework/phpbb_database_test_case.php +++ b/tests/test_framework/phpbb_database_test_case.php @@ -11,7 +11,9 @@ * */ -abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_TestCase +use PHPUnit\DbUnit\TestCase; + +abstract class phpbb_database_test_case extends TestCase { static private $already_connected; @@ -99,7 +101,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test parent::tearDownAfterClass(); } - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); @@ -113,7 +115,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test } } - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 844fc4619d..b594e48864 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -75,7 +75,7 @@ class phpbb_functional_test_case extends phpbb_test_case return array(); } - public function setUp() + public function setUp(): void { parent::setUp(); @@ -114,7 +114,7 @@ class phpbb_functional_test_case extends phpbb_test_case } } - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); @@ -511,7 +511,7 @@ class phpbb_functional_test_case extends phpbb_test_case $this->disable_ext($extension); $this->delete_ext_data($extension); } - + static private function recreate_database($config) { $db_conn_mgr = new phpbb_database_test_connection_manager($config); @@ -920,7 +920,7 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $haystack Search this * @param string $message Optional failure message */ - public function assertContainsLang($needle, $haystack, $message = null) + public function assertContainsLang($needle, $haystack, $message = '') { $this->assertContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message); } @@ -932,7 +932,7 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $haystack Search this * @param string $message Optional failure message */ - public function assertNotContainsLang($needle, $haystack, $message = null) + public function assertNotContainsLang($needle, $haystack, $message = '') { $this->assertNotContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message); } diff --git a/tests/test_framework/phpbb_session_test_case.php b/tests/test_framework/phpbb_session_test_case.php index 1e71ca6e69..02722c473e 100644 --- a/tests/test_framework/phpbb_session_test_case.php +++ b/tests/test_framework/phpbb_session_test_case.php @@ -25,7 +25,7 @@ abstract class phpbb_session_test_case extends phpbb_database_test_case /** @var \phpbb\db\driver\driver_interface */ protected $db; - function setUp() + function setUp(): void { parent::setUp(); diff --git a/tests/test_framework/phpbb_test_case.php b/tests/test_framework/phpbb_test_case.php index 01d26fb67d..b21e917a61 100644 --- a/tests/test_framework/phpbb_test_case.php +++ b/tests/test_framework/phpbb_test_case.php @@ -11,7 +11,9 @@ * */ -class phpbb_test_case extends PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +class phpbb_test_case extends TestCase { protected $test_case_helpers; diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php index c8ff7ba72b..d12572faf0 100644 --- a/tests/test_framework/phpbb_test_case_helpers.php +++ b/tests/test_framework/phpbb_test_case_helpers.php @@ -81,17 +81,17 @@ class phpbb_test_case_helpers { case E_NOTICE: case E_STRICT: - PHPUnit_Framework_Error_Notice::$enabled = true; - $exceptionName = 'PHPUnit_Framework_Error_Notice'; + PHPUnit\Framework\Error\Notice::$enabled = true; + $exceptionName = 'PHPUnit\Framework\Error\Notice'; break; case E_WARNING: - PHPUnit_Framework_Error_Warning::$enabled = true; - $exceptionName = 'PHPUnit_Framework_Error_Warning'; + PHPUnit\Framework\Error\Warning::$enabled = true; + $exceptionName = 'PHPUnit\Framework\Error\Warning'; break; default: - $exceptionName = 'PHPUnit_Framework_Error'; + $exceptionName = 'PHPUnit\Framework\Error\Error'; break; } $this->expectedTriggerError = true; diff --git a/tests/test_framework/phpbb_ui_test_case.php b/tests/test_framework/phpbb_ui_test_case.php index 09b0927966..2d249f5c73 100644 --- a/tests/test_framework/phpbb_ui_test_case.php +++ b/tests/test_framework/phpbb_ui_test_case.php @@ -105,7 +105,7 @@ class phpbb_ui_test_case extends phpbb_test_case return array(); } - public function setUp() + public function setUp(): void { if (!self::$install_success) { @@ -137,7 +137,7 @@ class phpbb_ui_test_case extends phpbb_test_case } } - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); @@ -424,7 +424,7 @@ class phpbb_ui_test_case extends phpbb_test_case $this->disable_ext($extension); $this->delete_ext_data($extension); } - + protected function get_cache_driver() { if (!$this->cache) diff --git a/tests/text_formatter/s9e/factory_test.php b/tests/text_formatter/s9e/factory_test.php index 1505609684..d3be7d2fb4 100644 --- a/tests/text_formatter/s9e/factory_test.php +++ b/tests/text_formatter/s9e/factory_test.php @@ -15,7 +15,7 @@ require_once __DIR__ . '/../../test_framework/phpbb_database_test_case.php'; class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case { - public function setUp() + public function setUp(): void { $this->cache = new phpbb_mock_cache; $this->dispatcher = new phpbb_mock_event_dispatcher; diff --git a/tests/text_processing/decode_message_test.php b/tests/text_processing/decode_message_test.php index e2402e721a..805dd89039 100644 --- a/tests/text_processing/decode_message_test.php +++ b/tests/text_processing/decode_message_test.php @@ -13,7 +13,7 @@ class phpbb_text_processing_decode_message_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/text_processing/generate_text_for_display_test.php b/tests/text_processing/generate_text_for_display_test.php index 22d6d26c75..f7da27cc35 100644 --- a/tests/text_processing/generate_text_for_display_test.php +++ b/tests/text_processing/generate_text_for_display_test.php @@ -13,7 +13,7 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { global $cache, $user, $phpbb_dispatcher; diff --git a/tests/text_processing/generate_text_for_storage_test.php b/tests/text_processing/generate_text_for_storage_test.php index f0588fec4f..c6c62c7579 100644 --- a/tests/text_processing/generate_text_for_storage_test.php +++ b/tests/text_processing/generate_text_for_storage_test.php @@ -13,7 +13,7 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { global $config, $phpbb_container, $phpbb_dispatcher; diff --git a/tests/text_reparser/base_test.php b/tests/text_reparser/base_test.php index 2c6844b063..59604da4e3 100644 --- a/tests/text_reparser/base_test.php +++ b/tests/text_reparser/base_test.php @@ -17,7 +17,7 @@ class phpbb_textreparser_base_test extends phpbb_database_test_case { protected $db; - public function setUp() + public function setUp(): void { global $config; if (!isset($config)) diff --git a/tests/text_reparser/manager_test.php b/tests/text_reparser/manager_test.php index df6adacb66..afa557deff 100644 --- a/tests/text_reparser/manager_test.php +++ b/tests/text_reparser/manager_test.php @@ -30,7 +30,7 @@ class phpbb_text_reparser_manager_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config_text.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/text_reparser/plugins/contact_admin_info_test.php b/tests/text_reparser/plugins/contact_admin_info_test.php index 757b02be39..690d3a4046 100644 --- a/tests/text_reparser/plugins/contact_admin_info_test.php +++ b/tests/text_reparser/plugins/contact_admin_info_test.php @@ -39,7 +39,7 @@ class phpbb_textreparser_contact_admin_info_test extends phpbb_database_test_cas return $rows; } - public function setUp() + public function setUp(): void { global $config; if (!isset($config)) diff --git a/tests/text_reparser/plugins/poll_option_test.php b/tests/text_reparser/plugins/poll_option_test.php index 177faac51d..32fb8a0411 100644 --- a/tests/text_reparser/plugins/poll_option_test.php +++ b/tests/text_reparser/plugins/poll_option_test.php @@ -39,7 +39,7 @@ class phpbb_textreparser_poll_option_test extends phpbb_database_test_case return $rows; } - public function setUp() + public function setUp(): void { global $config; if (!isset($config)) diff --git a/tests/text_reparser/plugins/test_row_based_plugin.php b/tests/text_reparser/plugins/test_row_based_plugin.php index 3e9ff09448..cf913c9c1e 100644 --- a/tests/text_reparser/plugins/test_row_based_plugin.php +++ b/tests/text_reparser/plugins/test_row_based_plugin.php @@ -39,7 +39,7 @@ abstract class phpbb_textreparser_test_row_based_plugin extends phpbb_database_t return $rows; } - public function setUp() + public function setUp(): void { global $config; if (!isset($config)) diff --git a/tests/tree/nestedset_forum_base.php b/tests/tree/nestedset_forum_base.php index 498c6a69a2..e91e816b2a 100644 --- a/tests/tree/nestedset_forum_base.php +++ b/tests/tree/nestedset_forum_base.php @@ -48,7 +48,7 @@ class phpbb_tests_tree_nestedset_forum_base extends phpbb_database_test_case $lock, $db; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php index e8b5d22205..656b801372 100644 --- a/tests/upload/filespec_test.php +++ b/tests/upload/filespec_test.php @@ -28,7 +28,7 @@ class phpbb_filespec_test extends phpbb_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - protected function setUp() + protected function setUp(): void { // Global $config required by unique_id global $config, $phpbb_root_path, $phpEx; @@ -101,7 +101,7 @@ class phpbb_filespec_test extends phpbb_test_case return $filespec->set_upload_ary(array_merge($upload_ary, $override)); } - protected function tearDown() + protected function tearDown(): void { $this->config = array(); diff --git a/tests/upload/fileupload_test.php b/tests/upload/fileupload_test.php index 84fc00bf98..ca9259d357 100644 --- a/tests/upload/fileupload_test.php +++ b/tests/upload/fileupload_test.php @@ -37,7 +37,7 @@ class phpbb_fileupload_test extends phpbb_test_case /** @var string phpBB root path */ protected $phpbb_root_path; - protected function setUp() + protected function setUp(): void { // Global $config required by unique_id global $config, $phpbb_root_path, $phpEx; @@ -107,7 +107,7 @@ class phpbb_fileupload_test extends phpbb_test_case return $filespec; } - protected function tearDown() + protected function tearDown(): void { // Clear globals global $config, $user; diff --git a/tests/upload/imagesize_test.php b/tests/upload/imagesize_test.php index 5429bb5c5e..3adf61dedc 100644 --- a/tests/upload/imagesize_test.php +++ b/tests/upload/imagesize_test.php @@ -20,7 +20,7 @@ class phpbb_upload_imagesize_test extends \phpbb_test_case /** @var string Path to fixtures */ protected $path; - public function setUp() + public function setUp(): void { parent::setUp(); $this->imagesize = new \FastImageSize\FastImageSize(); diff --git a/tests/user/user_loader_test.php b/tests/user/user_loader_test.php index f871f324ca..f283e993dc 100644 --- a/tests/user/user_loader_test.php +++ b/tests/user/user_loader_test.php @@ -21,7 +21,7 @@ class phpbb_user_loader_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/user_loader.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/version/version_fetch_test.php b/tests/version/version_fetch_test.php index c44bd5514a..188b371c47 100644 --- a/tests/version/version_fetch_test.php +++ b/tests/version/version_fetch_test.php @@ -16,7 +16,7 @@ */ class phpbb_version_helper_fetch_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/version/version_helper_remote_test.php b/tests/version/version_helper_remote_test.php index 7b8d71181f..e15ff897b0 100644 --- a/tests/version/version_helper_remote_test.php +++ b/tests/version/version_helper_remote_test.php @@ -17,7 +17,7 @@ class version_helper_remote_test extends \phpbb_test_case protected $cache; protected $version_helper; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/version/version_test.php b/tests/version/version_test.php index 2a0240f847..3298213487 100644 --- a/tests/version/version_test.php +++ b/tests/version/version_test.php @@ -13,7 +13,7 @@ class phpbb_version_helper_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/viewonline/helper_test.php b/tests/viewonline/helper_test.php index 6540d33287..d7c9965ad1 100644 --- a/tests/viewonline/helper_test.php +++ b/tests/viewonline/helper_test.php @@ -13,7 +13,7 @@ class phpbb_viewonline_helper_test extends phpbb_test_case { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/wrapper/phpbb_php_ini_test.php b/tests/wrapper/phpbb_php_ini_test.php index 5827744702..d6ce11219f 100644 --- a/tests/wrapper/phpbb_php_ini_test.php +++ b/tests/wrapper/phpbb_php_ini_test.php @@ -18,7 +18,7 @@ class phpbb_wrapper_phpbb_php_ini_test extends phpbb_test_case /** @var \phpbb_php_ini_fake php_ini */ protected $php_ini; - public function setUp() + public function setUp(): void { $this->php_ini = new phpbb_php_ini_fake; } |