reset() public method

Set the properties to the default values
public reset ( array | null $properties = null )
$properties array | null An optional array of properties to set after setting it to the default values
コード例 #1
0
ファイル: DeviceTest.php プロジェクト: whichbrowser/parser
 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());
 }