diff --git a/tests/integration/PostEntityLifecycleTest.php b/tests/integration/PostEntityLifecycleTest.php index 345e89c..097c951 100644 --- a/tests/integration/PostEntityLifecycleTest.php +++ b/tests/integration/PostEntityLifecycleTest.php @@ -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 { diff --git a/tests/integration/PostMigrationTest.php b/tests/integration/PostMigrationTest.php index f10edef..164a118 100644 --- a/tests/integration/PostMigrationTest.php +++ b/tests/integration/PostMigrationTest.php @@ -114,6 +114,10 @@ class PostMigrationTest 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 function seed_post( int $id, string $post_type ): void {