|
@@ 43-51 (lines=9) @@
|
| 40 |
|
} |
| 41 |
|
|
| 42 |
|
/** @test */ |
| 43 |
|
public function it_returns_correct_matched_bot_name() |
| 44 |
|
{ |
| 45 |
|
$this->CrawlerDetect = new CrawlerDetect(); |
| 46 |
|
$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(), 'monitoring', $matches); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
/** @test */ |
| 54 |
|
public function it_returns_full_matched_bot_name() |
|
@@ 54-62 (lines=9) @@
|
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
/** @test */ |
| 54 |
|
public function it_returns_full_matched_bot_name() |
| 55 |
|
{ |
| 56 |
|
$this->CrawlerDetect = new CrawlerDetect(); |
| 57 |
|
$this->CrawlerDetect->isCrawler('somenaughtybot'); |
| 58 |
|
|
| 59 |
|
$matches = $this->CrawlerDetect->getMatches(); |
| 60 |
|
|
| 61 |
|
$this->assertEquals($this->CrawlerDetect->getMatches(), 'somenaughtybot', $matches); |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
/** @test */ |
| 65 |
|
public function it_returns_null_when_no_bot_detected() |
|
@@ 65-73 (lines=9) @@
|
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
/** @test */ |
| 65 |
|
public function it_returns_null_when_no_bot_detected() |
| 66 |
|
{ |
| 67 |
|
$this->CrawlerDetect = new CrawlerDetect(); |
| 68 |
|
$this->CrawlerDetect->isCrawler('nothing to see here'); |
| 69 |
|
|
| 70 |
|
$matches = $this->CrawlerDetect->getMatches(); |
| 71 |
|
|
| 72 |
|
$this->assertNull($this->CrawlerDetect->getMatches()); |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
/** @test */ |
| 76 |
|
public function empty_user_agent() |