ollama = $this->createMock(OllamaClientInterface::class); $this->agent = new OllamaVisionAgent($this->ollama, 'llava'); } public function testParsesModelAndSerialFromResponse(): void { $this->ollama->method('generateWithImage') ->willReturn("MODEL: Dell Latitude 5520\nSERIAL: ABC12345"); $result = $this->agent->analyze('/tmp/photo.jpg'); self::assertSame('Dell Latitude 5520', $result['model']); self::assertSame('ABC12345', $result['serial']); } public function testReturnsEmptyStringsWhenNotFound(): void { $this->ollama->method('generateWithImage') ->willReturn('I cannot read the nameplate clearly.'); $result = $this->agent->analyze('/tmp/photo.jpg'); self::assertSame('', $result['model']); self::assertSame('', $result['serial']); } }