1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-14 12:44:06 +02:00

[ticket/16741] Test fixes

PHPBB3-16741
This commit is contained in:
Tristan Darricau
2021-11-09 02:49:56 +01:00
parent 6ce708539b
commit b266ebbcef
17 changed files with 154 additions and 69 deletions

View File

@@ -14,12 +14,14 @@
class phpbb_migrator_convert_timezones_test extends phpbb_database_test_case
{
protected $db;
protected $db_doctrine;
public function getDataSet()
{
$this->db = $this->new_dbal();
$this->db_doctrine = $this->new_doctrine_dbal();
$factory = new \phpbb\db\tools\factory();
$db_tools = $factory->get($this->db);
$db_tools = $factory->get($this->db_doctrine);
// user_dst doesn't exist anymore, must re-add it to test this
$db_tools->sql_column_add('phpbb_users', 'user_dst', array('BOOL', 1));
@@ -56,12 +58,13 @@ class phpbb_migrator_convert_timezones_test extends phpbb_database_test_case
global $phpbb_root_path, $phpEx;
$this->db = $this->new_dbal();
$this->db_doctrine = $this->new_doctrine_dbal();
$factory = new \phpbb\db\tools\factory();
$this->migration = new \phpbb\db\migration\data\v310\timezone(
new \phpbb\config\config(array()),
$this->db,
$factory->get($this->db),
$factory->get($this->db_doctrine),
$phpbb_root_path,
$phpEx,
'phpbb_',
@@ -94,7 +97,7 @@ class phpbb_migrator_convert_timezones_test extends phpbb_database_test_case
$this->db->sql_freeresult($result);
$factory = new \phpbb\db\tools\factory();
$db_tools = $factory->get($this->db);
$db_tools = $factory->get($this->db_doctrine);
// Remove the user_dst field again
$db_tools->sql_column_remove('phpbb_users', 'user_dst');

View File

@@ -21,6 +21,7 @@ class get_callable_from_step_test extends phpbb_database_test_case
$phpbb_log = $this->getMockBuilder('\phpbb\log\log')->disableOriginalConstructor()->getMock();
$db = $this->new_dbal();
$db_doctrine = $this->new_doctrine_dbal();
$factory = new \phpbb\db\tools\factory();
$user = $this->getMockBuilder('\phpbb\user')->disableOriginalConstructor()->getMock();
$user->ip = '127.0.0.1';
@@ -37,7 +38,7 @@ class get_callable_from_step_test extends phpbb_database_test_case
new phpbb_mock_container_builder(),
new \phpbb\config\config(array()),
$db,
$factory->get($db),
$factory->get($db_doctrine),
'phpbb_migrations',
$phpbb_root_path,
$php_ext,

View File

@@ -32,8 +32,9 @@ class schema_generator_test extends phpbb_test_case
$this->config = new \phpbb\config\config(array());
$this->db = new \phpbb\db\driver\sqlite3();
$this->doctrine_db = \phpbb\db\doctrine\connection_factory::get_connection(new phpbb_mock_config_php_file());
$factory = new \phpbb\db\tools\factory();
$this->db_tools = $factory->get($this->db);
$this->db_tools = $factory->get($this->doctrine_db);
$this->table_prefix = 'phpbb_';
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $phpEx;