assertTrue(Schema::hasTable($table), "{$table} should exist after migrate:fresh"); } foreach (self::LEGACY_TABLES as $legacy) { $this->assertFalse( Schema::hasTable($legacy), "legacy table {$legacy} should NOT exist after S2a purge" ); } } public function test_drop_legacy_tables_migration_is_one_way(): void { Artisan::call('migrate:fresh'); // step=1 targets the most recent migration — the S2a drop — // whose down() is a hard failure. $this->expectException(\RuntimeException::class); $this->expectExceptionMessage('Legacy registration tables cannot be restored'); Artisan::call('migrate:rollback', ['--step' => 1]); } }