Files
portal/app/tests/Unit/Services/MonthlyPartitionManagerTest.php
T

23 lines
1004 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
use App\Services\MonthlyPartitionManager;
// Unit test: verifies PARTITIONED_TABLES constant only — no DB.
// Added for TDD: project_routing_snapshots (snapshot_date key, Этап 2, 27.05.2026).
test('PARTITIONED_TABLES содержит project_routing_snapshots с ключом snapshot_date', function (): void {
expect(MonthlyPartitionManager::PARTITIONED_TABLES)
->toHaveKey('project_routing_snapshots')
->and(MonthlyPartitionManager::PARTITIONED_TABLES['project_routing_snapshots'])
->toBe('snapshot_date');
});
// Task 0.5 (imitation harness): verify that MonthlyPartitionManager::DDL_CONNECTION constant
// stays 'pgsql_supplier' (guard against accidental change when adding parent-exists check).
// Part of TDD sequence for migrate:fresh resilience fix.
test('DDL_CONNECTION константа остаётся pgsql_supplier', function (): void {
expect(MonthlyPartitionManager::DDL_CONNECTION)->toBe('pgsql_supplier');
});