コード例 #1
0
 /**
  * Sets the useragent to be parsed
  *
  * @param string $userAgent
  */
 public function setUserAgent($userAgent)
 {
     $this->reset();
     parent::setUserAgent($userAgent);
 }
コード例 #2
0
 /**
  * @dataProvider getVersionTruncationFixtures
  */
 public function testVersionTruncation($useragent, $truncationType, $osVersion, $clientVersion)
 {
     ParserAbstract::setVersionTruncation($truncationType);
     $dd = new DeviceDetector($useragent);
     $dd->parse();
     $this->assertEquals($osVersion, $dd->getOs('version'));
     $this->assertEquals($clientVersion, $dd->getClient('version'));
     ParserAbstract::setVersionTruncation(ParserAbstract::VERSION_TRUNCATION_NONE);
 }