Files
api/services/nginx/app/tests/Unit/Selfserve/EdgeGatewayOperationLegacySchemaCompatibilityTest.php
T
Jeppe Bundgaard 7d450e285e Remove outdated edge gateway object classes, add new agent implementation
Transitioned from obsolete gateway object classes (`edge_gateway_shell_action_jobs_o`, `edge_gateway_shell_events_o`, `edge_gateway_shell_sessions_o`, `edge_gateway_update_jobs_o`) to the new agent implementation (`edge-gateway-agent/agent.php`).
2026-04-21 14:13:17 +02:00

18 lines
1.1 KiB
PHP

<?php
it('keeps the legacy operation_type column compatible with v2 operation queueing', function (): void {
$bootstrapContent = file_get_contents(app_path('classes/edge_gateway_schema_bootstrap.php'));
$operationServiceContent = file_get_contents(app_path('classes/edge_gateway_operation_service.php'));
$operationObjectContent = file_get_contents(app_path('objects/edge_gateway_operations_o.php'));
expect($bootstrapContent)->not->toBeFalse();
expect($operationServiceContent)->not->toBeFalse();
expect($operationObjectContent)->not->toBeFalse();
expect($bootstrapContent)->toContain("ensureColumn('edge_gateway_operations', 'operation_type', \"VARCHAR(32) NOT NULL DEFAULT 'DISCOVERY' AFTER type\")");
expect($bootstrapContent)->toContain('private static function syncOperationTypeColumns(): void');
expect($bootstrapContent)->toContain('SET type = operation_type');
expect($operationServiceContent)->toContain("'operation_type' => \$type");
expect($operationObjectContent)->toContain("new object_property(\$this->table, \$this->id, 'operation_type', 'string', false)");
});