Add Edge Agent implementation for gateway connection lifecycle, agent commands, Shelly device discovery, relay control, and WebSocket communication with broker. Include unit tests for critical flows.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
it('defines the edge gateway runtime schema bootstrap tables', function (): void {
|
||||
$bootstrapContent = file_get_contents(app_path('classes/edge_gateway_schema_bootstrap.php'));
|
||||
|
||||
expect($bootstrapContent)->not->toBeFalse();
|
||||
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateways');
|
||||
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_claim_tokens');
|
||||
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_device_inventory');
|
||||
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_relay_bindings');
|
||||
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_command_jobs');
|
||||
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_update_jobs');
|
||||
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_shell_sessions');
|
||||
expect($bootstrapContent)->toContain('CREATE TABLE IF NOT EXISTS edge_gateway_audit_logs');
|
||||
});
|
||||
|
||||
it('stores edge gateway heartbeats, bindings, and shell transcript data', function (): void {
|
||||
$bootstrapContent = file_get_contents(app_path('classes/edge_gateway_schema_bootstrap.php'));
|
||||
|
||||
expect($bootstrapContent)->toContain('last_heartbeat_at DATETIME NULL');
|
||||
expect($bootstrapContent)->toContain('channel INT NOT NULL DEFAULT 0');
|
||||
expect($bootstrapContent)->toContain('transcript_text LONGTEXT NULL');
|
||||
expect($bootstrapContent)->toContain('context_json JSON NULL');
|
||||
});
|
||||
Reference in New Issue
Block a user