/** * Sets the useragent to be parsed * * @param string $userAgent */ public function setUserAgent($userAgent) { $this->reset(); parent::setUserAgent($userAgent); }
/** * @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); }