test(migration): PostMigrationTest / PostEntityLifecycleTest 補 flush_table_exists_cache
引入 table_exists request-scoped cache 後,其他測試類建立/drop 的 sibling flat 表(wpdo_post_attachment)會在快取留下 stale true,diagnose() 於是 去 COUNT 一張已被 drop 的表 → mysqli_sql_exception。 A 在 v3.4.6 踩過同一個坑,修法相同:兩個測試的 setUp 呼叫 Schema_Manager::flush_table_exists_cache()。 unit 451 / integration 398 GREEN Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
This commit is contained in:
@@ -150,6 +150,10 @@ class PostEntityLifecycleTest extends TestCase {
|
||||
$wpdb->query( 'TRUNCATE TABLE `' . self::POSTS . '`' );
|
||||
$wpdb->query( 'TRUNCATE TABLE `' . self::POSTMETA . '`' );
|
||||
$wpdb->query( 'TRUNCATE TABLE `' . self::FLAT . '`' );
|
||||
|
||||
// Other classes create/drop sibling flat tables (e.g. wpdo_post_attachment):
|
||||
// a stale table_exists() cache would make diagnose() COUNT a dropped table.
|
||||
TMDO_Schema_Manager::flush_table_exists_cache();
|
||||
}
|
||||
|
||||
private static function class_for( string $rel ): ?string {
|
||||
|
||||
Reference in New Issue
Block a user