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