[ticket/17525] Fix tests

PHPBB-17525
This commit is contained in:
rxu 2025-07-01 16:12:06 +07:00
parent 4274faa715
commit e9157f4d10
No known key found for this signature in database
GPG key ID: 8117904FEDEFDD17
3 changed files with 12 additions and 4 deletions

View file

@ -62,7 +62,7 @@ class doctrine implements tools_interface
}
/**
* @return Connection
* {@inheritDoc}
*/
public function get_connection(): Connection
{

View file

@ -226,4 +226,11 @@ interface tools_interface
* @return void
*/
public function sql_truncate_table(string $table_name): void;
/**
* Gets current Doctrine DBAL connection
*
* @return \Doctrine\DBAL\Connection
*/
public function get_connection(): \Doctrine\DBAL\Connection;
}

View file

@ -485,9 +485,10 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->assertNotEmpty($table_keys);
$short_table_names = \phpbb\db\doctrine\table_helper::map_short_table_names(['custom_table' => 'cstmtbl'], 'phpbb_');
$this->assertEquals('phpbb_custom_table', array_search('cstmtbl', $short_table_names));
$this->assertEquals($short_table_names['phpbb_custom_table'], 'cstmtbl');
$table_names = array_merge(array_keys($db_table_schema), ['phpbb_custom_table']);
$short_table_names = \phpbb\db\doctrine\table_helper::map_short_table_names($table_names, 'phpbb_');
$this->assertEquals('phpbb_custom_table', array_search(\phpbb\db\doctrine\table_helper::generate_shortname('custom_table'), $short_table_names));
$this->assertEquals($short_table_names['phpbb_custom_table'], \phpbb\db\doctrine\table_helper::generate_shortname('custom_table'));
foreach ($table_keys as $table_name => $key_names)
{