isDetected() public method

Check if device information is detected
public isDetected ( ) : boolean
return boolean
Example #1
0
 /**
  * Check if a browser was detected
  *
  * @return boolean
  */
 public function isDetected()
 {
     return $this->browser->isDetected() || $this->os->isDetected() || $this->engine->isDetected() || $this->device->isDetected();
 }
Example #2
0
 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());
 }