From 5e9d616f5760812cd5ed6b63dca0fefb4adf0b78 Mon Sep 17 00:00:00 2001 From: rxu Date: Wed, 25 Jun 2025 23:48:45 +0700 Subject: [PATCH] [ticket/17525] Map Sphinx table, add more test assertions PHPBB-17525 --- phpBB/phpbb/db/doctrine/table_helper.php | 3 ++- tests/dbal/migrator_test.php | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/db/doctrine/table_helper.php b/phpBB/phpbb/db/doctrine/table_helper.php index ec5c2040e8..972d31eab4 100644 --- a/phpBB/phpbb/db/doctrine/table_helper.php +++ b/phpBB/phpbb/db/doctrine/table_helper.php @@ -198,12 +198,13 @@ class table_helper "{$table_prefix}sessions_keys" => 'ssnkeys', "{$table_prefix}sitelist" => 'sitelst', "{$table_prefix}smilies" => 'smls', + "{$table_prefix}sphinx" => 'sphnx', "{$table_prefix}storage" => 'strg', "{$table_prefix}styles" => 'stls', "{$table_prefix}teampage" => 'teampg', "{$table_prefix}topics" => 'tpcs', "{$table_prefix}topics_posted" => 'tpcspstd', - "{$table_prefix}topics_track" => 'tpcstrk', + "{$table_prefix}topics_track" => 'tpcstrck', "{$table_prefix}topics_watch" => 'tpkswtch', "{$table_prefix}user_group" => 'usrgrp', "{$table_prefix}user_notifications" => 'usrntfs', diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index 454c05b5eb..e7fbd4eb2d 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -485,7 +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([], '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) { $index_prefix = $short_table_names[$table_name] . '_';