1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 03:04:09 +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

@@ -24,6 +24,7 @@ class phpbb_functional_test_case extends phpbb_test_case
protected $cache = null;
protected $db = null;
protected $db_doctrine = null;
protected $extension_manager = null;
/**
@@ -207,6 +208,16 @@ class phpbb_functional_test_case extends phpbb_test_case
return $this->db;
}
protected function get_db_doctrine()
{
// so we don't reopen an open connection
if (!($this->db_doctrine instanceof \Doctrine\DBAL\Connection))
{
$this->db_doctrine = \phpbb\db\doctrine\connection_factory::get_connection_from_params(self::$config['dbms'], self::$config['dbhost'], self::$config['dbuser'], self::$config['dbpasswd'], self::$config['dbname'], self::$config['dbport']);
}
return $this->db_doctrine;
}
protected function get_cache_driver()
{
if (!$this->cache)
@@ -238,9 +249,10 @@ class phpbb_functional_test_case extends phpbb_test_case
$config = new \phpbb\config\config(array('version' => PHPBB_VERSION));
$db = $this->get_db();
$db_doctrine = $this->get_db_doctrine();
$factory = new \phpbb\db\tools\factory();
$finder_factory = new \phpbb\finder\factory(null, false, $phpbb_root_path, $phpEx);
$db_tools = $factory->get($db);
$db_tools = $factory->get($db_doctrine);
$container = new phpbb_mock_container_builder();
$migrator = new \phpbb\db\migrator(