@@ -367,14 +367,22 @@ class SimulationExecutionTest extends TestCase
|
||||
$this->assertDatabaseHas('simulation_jobs', ['simulation_id' => $simulation->id, 'status' => 'failed', 'attempts' => 3]);
|
||||
}
|
||||
|
||||
public function test_empty_schema_rolls_back_and_reapplies_with_questionnaire_seed(): void
|
||||
public function test_core_rollback_refuses_published_path_definition_and_preserves_rls(): void
|
||||
{
|
||||
$migration = require database_path('migrations/2026_10_01_000200_create_simulation_execution_core.php');
|
||||
$migration->down();
|
||||
$this->assertFalse(Schema::hasTable('simulations'));
|
||||
$migration->up();
|
||||
// The full installation is no longer a base-only empty schema: it owns a second immutable definition.
|
||||
$before = DB::select('SELECT relname,relrowsecurity,relforcerowsecurity FROM pg_class WHERE relnamespace = to_regnamespace(?) AND relname IN (?,?) ORDER BY relname', ['public', 'simulations', 'questionnaire_versions']);
|
||||
try {
|
||||
$migration->down();
|
||||
$this->fail('A published path definition must not be silently erased by fiscal core rollback.');
|
||||
} catch (\RuntimeException $exception) {
|
||||
$this->assertSame('Cannot rollback simulation execution: questionnaire_versions contains data.', $exception->getMessage());
|
||||
}
|
||||
$after = DB::select('SELECT relname,relrowsecurity,relforcerowsecurity FROM pg_class WHERE relnamespace = to_regnamespace(?) AND relname IN (?,?) ORDER BY relname', ['public', 'simulations', 'questionnaire_versions']);
|
||||
$this->assertEquals($before, $after);
|
||||
$this->assertTrue(Schema::hasTable('simulation_results'));
|
||||
$this->assertDatabaseHas('questionnaire_versions', ['id' => '61000100-0000-4000-8000-000000000001', 'status' => 'published']);
|
||||
$this->assertDatabaseHas('questionnaire_versions', ['code' => 'investor-path-19', 'status' => 'published']);
|
||||
}
|
||||
|
||||
public function test_questionnaire_endpoint_exposes_only_published_version_with_etag(): void
|
||||
|
||||
Reference in New Issue
Block a user