public function testIdentifyVersion() { $engine = new Engine(); $engine->identifyVersion('/AppleWebKit\\/([0-9\\.]+)/u', 'AppleWebKit/601.3.9'); $this->assertEquals('601.3.9', $engine->getVersion()); $engine->reset(); $engine->identifyVersion('/AppleWebKit\\/([0-9\\.]+)/u', 'Gecko/19.0'); $this->assertEquals('', $engine->getVersion()); $engine->reset(); $engine->identifyVersion('/AppleWebKit\\/([0-9\\.]+)/u', 'AppleWebKit/601.3.9', ['details' => 1]); $this->assertEquals('601', $engine->getVersion()); }
/** * * @param Model\RenderingEngine $engine * @param \WhichBrowser\Model\Engine $engineRaw */ private function hydrateRenderingEngine(Model\RenderingEngine $engine, \WhichBrowser\Model\Engine $engineRaw) { $engine->setName($this->getRealResult($engineRaw->getName())); $engine->getVersion()->setComplete($this->getRealResult($engineRaw->getVersion())); }