public function testSetWithoutIdentified() { $device = new Device(); $device->set(['manufacturer' => 'Microsoft', 'model' => 'Xbox One']); $this->assertEquals('', $device->getManufacturer()); $this->assertEquals('Xbox One', $device->getModel()); $this->assertEquals(true, $device->generic); }
/** * * @param Model\Device $device * @param \WhichBrowser\Model\Device $deviceRaw * @param WhichBrowserParser $parser */ private function hydrateDevice(Model\Device $device, \WhichBrowser\Model\Device $deviceRaw, WhichBrowserParser $parser) { $device->setModel($this->getRealResult($deviceRaw->getModel())); $device->setBrand($this->getRealResult($deviceRaw->getManufacturer())); $device->setType($this->getRealResult($parser->getType())); if ($parser->isMobile() === true) { $device->setIsMobile(true); } }