Beispiel #1
0
 public function testCreatingParserWithoutArgumentsAndCallAnalyse()
 {
     $parser = new Parser();
     $parser->analyse("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; InfoPath.1)");
     $this->assertTrue($parser instanceof \WhichBrowser\Parser);
     $this->assertTrue($parser->isBrowser('Internet Explorer', '=', '6.0'));
 }
Beispiel #2
0
 public function testCreatingParserWithOptions()
 {
     $parser = new Parser(['headers' => ['User-Agent' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; InfoPath.1)']]);
     $this->assertTrue($parser instanceof \WhichBrowser\Parser);
     $this->assertTrue($parser->isBrowser('Internet Explorer', '=', '6.0'));
 }