mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/17176] Fix some PHP 8.x deprecations and clean up test code
PHPBB3-17176
This commit is contained in:
parent
20a2ee2682
commit
9fbe00dd45
12 changed files with 67 additions and 5 deletions
|
@ -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');
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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.,_!?/\\';
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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'])
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue