[ticket/17525] Map Sphinx table, add more test assertions

PHPBB-17525
This commit is contained in:
rxu 2025-06-25 23:48:45 +07:00
parent de1f6329ff
commit 5e9d616f57
No known key found for this signature in database
GPG key ID: 955F0567380E586A
2 changed files with 6 additions and 2 deletions

View file

@ -198,12 +198,13 @@ class table_helper
"{$table_prefix}sessions_keys" => 'ssnkeys', "{$table_prefix}sessions_keys" => 'ssnkeys',
"{$table_prefix}sitelist" => 'sitelst', "{$table_prefix}sitelist" => 'sitelst',
"{$table_prefix}smilies" => 'smls', "{$table_prefix}smilies" => 'smls',
"{$table_prefix}sphinx" => 'sphnx',
"{$table_prefix}storage" => 'strg', "{$table_prefix}storage" => 'strg',
"{$table_prefix}styles" => 'stls', "{$table_prefix}styles" => 'stls',
"{$table_prefix}teampage" => 'teampg', "{$table_prefix}teampage" => 'teampg',
"{$table_prefix}topics" => 'tpcs', "{$table_prefix}topics" => 'tpcs',
"{$table_prefix}topics_posted" => 'tpcspstd', "{$table_prefix}topics_posted" => 'tpcspstd',
"{$table_prefix}topics_track" => 'tpcstrk', "{$table_prefix}topics_track" => 'tpcstrck',
"{$table_prefix}topics_watch" => 'tpkswtch', "{$table_prefix}topics_watch" => 'tpkswtch',
"{$table_prefix}user_group" => 'usrgrp', "{$table_prefix}user_group" => 'usrgrp',
"{$table_prefix}user_notifications" => 'usrntfs', "{$table_prefix}user_notifications" => 'usrntfs',

View file

@ -485,7 +485,10 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->assertNotEmpty($table_keys); $this->assertNotEmpty($table_keys);
$short_table_names = \phpbb\db\doctrine\table_helper::map_short_table_names([], 'phpbb_'); $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');
foreach ($table_keys as $table_name => $key_names) foreach ($table_keys as $table_name => $key_names)
{ {
$index_prefix = $short_table_names[$table_name] . '_'; $index_prefix = $short_table_names[$table_name] . '_';