mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-10 03:36:31 +02:00
[ticket/16741] Fix tests
PHPBB3-16741
This commit is contained in:
@ -116,6 +116,11 @@ class container_builder
|
|||||||
*/
|
*/
|
||||||
private $env_parameters = [];
|
private $env_parameters = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \phpbb\db\driver\driver_interface
|
||||||
|
*/
|
||||||
|
protected $dbal_connection = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -568,20 +573,22 @@ class container_builder
|
|||||||
$config_data = $this->config_php_file->get_all();
|
$config_data = $this->config_php_file->get_all();
|
||||||
if (!empty($config_data))
|
if (!empty($config_data))
|
||||||
{
|
{
|
||||||
$dbal_driver_class = \phpbb\config_php_file::convert_30_dbms_to_31($this->config_php_file->get('dbms'));
|
if ($this->dbal_connection === null)
|
||||||
/** @var \phpbb\db\driver\driver_interface $dbal_connection */
|
{
|
||||||
$dbal_connection = new $dbal_driver_class();
|
$dbal_driver_class = \phpbb\config_php_file::convert_30_dbms_to_31($this->config_php_file->get('dbms'));
|
||||||
$dbal_connection->sql_connect(
|
/** @var \phpbb\db\driver\driver_interface $dbal_connection */
|
||||||
$this->config_php_file->get('dbhost'),
|
$this->dbal_connection = new $dbal_driver_class();
|
||||||
$this->config_php_file->get('dbuser'),
|
$this->dbal_connection->sql_connect(
|
||||||
$this->config_php_file->get('dbpasswd'),
|
$this->config_php_file->get('dbhost'),
|
||||||
$this->config_php_file->get('dbname'),
|
$this->config_php_file->get('dbuser'),
|
||||||
$this->config_php_file->get('dbport'),
|
$this->config_php_file->get('dbpasswd'),
|
||||||
false,
|
$this->config_php_file->get('dbname'),
|
||||||
defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK
|
$this->config_php_file->get('dbport'),
|
||||||
);
|
false,
|
||||||
//$this->dbal_connection_doctrine = connection_factory::get_connection($this->config_php_file);
|
defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK
|
||||||
$this->container->set('dbal.conn.driver', $dbal_connection);
|
);
|
||||||
|
}
|
||||||
|
$this->container->set('dbal.conn.driver', $this->dbal_connection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
|
|||||||
public function test_perform_schema_changes_drop_tables()
|
public function test_perform_schema_changes_drop_tables()
|
||||||
{
|
{
|
||||||
$db_tools = $this->getMockBuilder('\phpbb\db\tools\doctrine')
|
$db_tools = $this->getMockBuilder('\phpbb\db\tools\doctrine')
|
||||||
->onlyMethods(array('sql_table_exists', '_schema_drop_table'))
|
->onlyMethods(array('sql_table_exists', 'schema_drop_table'))
|
||||||
->setConstructorArgs(array($this->doctrine_db))
|
->setConstructorArgs(array($this->doctrine_db))
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
@ -369,7 +369,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
|
|||||||
->will($this->returnValue(true));
|
->will($this->returnValue(true));
|
||||||
|
|
||||||
// drop tables
|
// drop tables
|
||||||
$db_tools->expects($this->exactly(2))->method('_schema_drop_table')
|
$db_tools->expects($this->exactly(2))->method('schema_drop_table')
|
||||||
->withConsecutive(
|
->withConsecutive(
|
||||||
[$this->isInstanceOf(Schema::class), 'dropped_table_1', true],
|
[$this->isInstanceOf(Schema::class), 'dropped_table_1', true],
|
||||||
[$this->isInstanceOf(Schema::class), 'dropped_table_2', true]
|
[$this->isInstanceOf(Schema::class), 'dropped_table_2', true]
|
||||||
|
Reference in New Issue
Block a user