'pi-1', 'camera_id' => 'cam-1', 'event_type' => 'fall', 'severity' => 'high', 'occurred_at' => 1000.0, 'snapshots' => ['aGk=']]; } public function testAcceptsValid(): void { $r = EventValidator::validate($this->valid()); $this->assertTrue($r['ok'], implode(',', $r['errors'])); $this->assertSame('fall', $r['clean']['event_type']); } public function testRejectsUnknownEventType(): void { $p = $this->valid(); $p['event_type'] = 'explode'; $this->assertFalse(EventValidator::validate($p)['ok']); } public function testRejectsUnknownSeverity(): void { $p = $this->valid(); $p['severity'] = 'ULTRA'; $this->assertFalse(EventValidator::validate($p)['ok']); } public function testRejectsMissingRequired(): void { $p = $this->valid(); unset($p['device_id']); $this->assertFalse(EventValidator::validate($p)['ok']); } public function testRejectsTooManySnapshots(): void { $p = $this->valid(); $p['snapshots'] = ['a', 'b', 'c', 'd']; $this->assertFalse(EventValidator::validate($p)['ok']); } }