public function testParseNoBot() { $botParser = new Bot(); $botParser->setUserAgent('Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; SV1; SE 2.x)'); $this->assertNull($botParser->parse()); }
/** * Parses the UA for bot information using the Bot parser */ protected function parseBot() { if ($this->skipBotDetection) { $this->bot = false; return false; } $botParser = new Bot(); $botParser->setUserAgent($this->getUserAgent()); $botParser->setYamlParser($this->getYamlParser()); $botParser->setCache($this->getCache()); if ($this->discardBotInformation) { $botParser->discardDetails(); } $this->bot = $botParser->parse(); }
/** * Parses the UA for bot information using the Bot parser */ protected function parseBot() { $botParser = new Bot(); $botParser->setUserAgent($this->getUserAgent()); $botParser->setCache($this->getCache()); if ($this->discardBotInformation) { $botParser->discardDetails(); } $this->bot = $botParser->parse(); }
/** * @dataProvider getFixtures */ public function testParse($useragent, $bot) { $borParser = new Bot(); $borParser->setUserAgent($useragent); $this->assertEquals($bot, $borParser->parse()); }