Check if device information is detected
public isDetected ( ) : boolean | ||
return | boolean |
/** * Check if a browser was detected * * @return boolean */ public function isDetected() { return $this->browser->isDetected() || $this->os->isDetected() || $this->engine->isDetected() || $this->device->isDetected(); }
public function testDetected() { $device = new Device(); $this->assertFalse($device->isDetected()); $device->set(['manufacturer' => 'Microsoft', 'model' => 'Xbox One']); $this->assertTrue($device->isDetected()); $device->reset(); $this->assertFalse($device->isDetected()); $device->set(['model' => 'Xbox One']); $this->assertTrue($device->isDetected()); $device->set(['manufacturer' => 'Microsoft']); $this->assertTrue($device->isDetected()); }