Example #1
0
 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());
 }
Example #2
0
 /**
  * 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();
 }
Example #4
0
 /**
  * @dataProvider getFixtures
  */
 public function testParse($useragent, $bot)
 {
     $borParser = new Bot();
     $borParser->setUserAgent($useragent);
     $this->assertEquals($bot, $borParser->parse());
 }