diff --git a/tests/attachment/upload_test.php b/tests/attachment/upload_test.php index 298ffcfd98..609ee99536 100644 --- a/tests/attachment/upload_test.php +++ b/tests/attachment/upload_test.php @@ -69,6 +69,9 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case /** @var \phpbb\request\request */ protected $request; + /** @var string */ + protected $phpbb_root_path; + public function getDataSet() { return $this->createXMLDataSet(__DIR__ . '/fixtures/resync.xml'); diff --git a/tests/controller/controller_test.php b/tests/controller/controller_test.php index 0b348fa6ba..03d8e89d87 100644 --- a/tests/controller/controller_test.php +++ b/tests/controller/controller_test.php @@ -21,6 +21,9 @@ use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; class phpbb_controller_controller_test extends phpbb_test_case { + /** @var phpbb_mock_extension_manager */ + protected $extension_manager; + protected function setUp(): void { $this->extension_manager = new phpbb_mock_extension_manager( diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index a2d380e585..5d16fa63ee 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -42,6 +42,9 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case /** @var \phpbb\config\config */ protected $config; + /** @var \phpbb\extension\manager */ + protected $extension_manager; + public function getDataSet() { return $this->createXMLDataSet(__DIR__.'/fixtures/migrator.xml'); diff --git a/tests/dbal/migrator_tool_config_test.php b/tests/dbal/migrator_tool_config_test.php index 01f5d9e54f..853b33b117 100644 --- a/tests/dbal/migrator_tool_config_test.php +++ b/tests/dbal/migrator_tool_config_test.php @@ -13,6 +13,12 @@ class phpbb_dbal_migrator_tool_config_test extends phpbb_test_case { + /** @var \phpbb\config\config */ + protected $config; + + /** @var \phpbb\db\migration\tool\tool_interface */ + protected $tool; + protected function setUp(): void { $this->config = new \phpbb\config\config(array()); diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php index 68e31d0af0..73ac5a51de 100644 --- a/tests/extension/manager_test.php +++ b/tests/extension/manager_test.php @@ -30,7 +30,6 @@ class phpbb_extension_manager_test extends phpbb_database_test_case { parent::setUp(); - $this->db = null; $this->extension_manager = $this->create_extension_manager(); } diff --git a/tests/functions/obtain_online_test.php b/tests/functions/obtain_online_test.php index f47da03027..1a2d000d0d 100644 --- a/tests/functions/obtain_online_test.php +++ b/tests/functions/obtain_online_test.php @@ -162,7 +162,7 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case global $config, $user, $auth, $phpbb_dispatcher; $config['load_online_guests'] = $display_guests; - $user = new phpbb_mock_lang(); + $user = new phpbb_mock_user(); $user->data['user_id'] = 100; $user->lang = $this->load_language(); $auth = $this->createMock('\phpbb\auth\auth'); diff --git a/tests/migrations/migrations_check_config_added_test.php b/tests/migrations/migrations_check_config_added_test.php index f4b8067ae1..969a0f5e79 100644 --- a/tests/migrations/migrations_check_config_added_test.php +++ b/tests/migrations/migrations_check_config_added_test.php @@ -13,6 +13,36 @@ class migrations_check_config_added_test extends phpbb_test_case { + /** @var \phpbb\config\config */ + protected $config; + + /** @var \Symfony\Component\DependencyInjection\ContainerInterface */ + protected $container; + + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + /** @var \Doctrine\DBAL\Connection */ + protected $db_doctrine; + + /** @var \phpbb\db\tools\tools_interface */ + protected $db_tools; + + /** @var \phpbb\extension\manager */ + protected $extension_manager; + + /** @var \phpbb\db\migrator */ + protected $migrator; + + /** @var string */ + protected $table_prefix; + + /** @var string */ + protected $phpbb_root_path; + + /** @var string */ + protected $php_ext; + protected function setUp(): void { global $phpbb_root_path; diff --git a/tests/passwords/drivers_test.php b/tests/passwords/drivers_test.php index 9c2aa8b160..51da57c278 100644 --- a/tests/passwords/drivers_test.php +++ b/tests/passwords/drivers_test.php @@ -13,6 +13,9 @@ class phpbb_passwords_helper_test extends \phpbb_test_case { + /** @var array */ + protected $passwords_drivers = []; + protected function setUp(): void { // Prepare dependencies for drivers @@ -21,7 +24,7 @@ class phpbb_passwords_helper_test extends \phpbb_test_case $this->driver_helper = new \phpbb\passwords\driver\helper($config); $phpbb_root_path = __DIR__ . '/../../phpBB/'; $php_ext = 'php'; - + // Initialize argon2 default options $this->argon2_default_cost_options = [ 'memory_cost' => 65536, diff --git a/tests/passwords/manager_test.php b/tests/passwords/manager_test.php index 2159160273..7b1b9a1cc3 100644 --- a/tests/passwords/manager_test.php +++ b/tests/passwords/manager_test.php @@ -13,6 +13,15 @@ class phpbb_passwords_manager_test extends \phpbb_test_case { + /** @var \phpbb\passwords\driver\helper */ + protected $driver_helper; + + /** @var \phpbb\passwords\helper */ + protected $helper; + + /** @var \phpbb\passwords\manager */ + protected $manager; + protected $passwords_drivers; protected $pw_characters = '0123456789abcdefghijklmnopqrstuvwyzABCDEFGHIJKLMNOPQRSTUVXYZ.,_!?/\\'; diff --git a/tests/template/extension_test.php b/tests/template/extension_test.php index bf8d4f568c..f7e30b35b1 100644 --- a/tests/template/extension_test.php +++ b/tests/template/extension_test.php @@ -88,7 +88,7 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case $class = new ReflectionClass('\phpbb\avatar\manager'); $enabled_drivers = $class->getProperty('enabled_drivers'); $enabled_drivers->setAccessible(true); - $enabled_drivers->setValue(false); + $enabled_drivers->setValue($class, false); $this->template_path = $this->test_path . '/templates'; diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php index 277313ccc3..8131567131 100644 --- a/tests/template/template_test_case_with_tree.php +++ b/tests/template/template_test_case_with_tree.php @@ -15,6 +15,12 @@ require_once __DIR__ . '/template_test_case.php'; class phpbb_template_template_test_case_with_tree extends phpbb_template_template_test_case { + /** @var \phpbb\path_helper */ + protected $phpbb_path_helper; + + /** @var string */ + protected $parent_template_path; + protected function setup_engine(array $new_config = array()) { global $phpbb_root_path, $phpEx, $user; diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php index c21a8fc95d..db73248f6c 100644 --- a/tests/test_framework/phpbb_database_test_connection_manager.php +++ b/tests/test_framework/phpbb_database_test_connection_manager.php @@ -520,7 +520,7 @@ class phpbb_database_test_connection_manager $queries = array(); // Get escaped versions of the table names to synchronise - $table_names = array_map(array($this->pdo, 'PDO::quote'), array_keys($table_column_map)); + $table_names = array_map([$this->pdo, 'quote'], array_keys($table_column_map)); switch ($this->config['dbms']) {