setVersionTruncation() public static method

Set how DeviceDetector should return versions
public static setVersionTruncation ( integer | null $type )
$type integer | null Any of the VERSION_TRUNCATION_* constants
Esempio n. 1
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);
 }