|
@@ 44-51 (lines=8) @@
|
| 41 |
|
} |
| 42 |
|
} |
| 43 |
|
|
| 44 |
|
public function testReturnsCorrectMatchedBotName() |
| 45 |
|
{ |
| 46 |
|
$test = $this->CrawlerDetect->isCrawler('Mozilla/5.0 (iPhone; CPU iPhone OS 7_1 like Mac OS X) AppleWebKit (KHTML, like Gecko) Mobile (compatible; Yahoo Ad monitoring; https://help.yahoo.com/kb/yahoo-ad-monitoring-SLN24857.html)'); |
| 47 |
|
|
| 48 |
|
$matches = $this->CrawlerDetect->getMatches(); |
| 49 |
|
|
| 50 |
|
$this->assertEquals($this->CrawlerDetect->getMatches(), 'Yahoo Ad monitoring', $matches); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
public function testReturnsNullWhenNoBotDetected() |
| 54 |
|
{ |
|
@@ 53-60 (lines=8) @@
|
| 50 |
|
$this->assertEquals($this->CrawlerDetect->getMatches(), 'Yahoo Ad monitoring', $matches); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
public function testReturnsNullWhenNoBotDetected() |
| 54 |
|
{ |
| 55 |
|
$test = $this->CrawlerDetect->isCrawler('nothing to see here'); |
| 56 |
|
|
| 57 |
|
$matches = $this->CrawlerDetect->getMatches(); |
| 58 |
|
|
| 59 |
|
$this->assertEquals($this->CrawlerDetect->getMatches(), null, $matches); |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
public function testEmptyUserAgent() |
| 63 |
|
{ |