|
@@ 48-55 (lines=8) @@
|
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
/** @test */ |
| 48 |
|
public function it_returns_correct_matched_bot_name() |
| 49 |
|
{ |
| 50 |
|
$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)'); |
| 51 |
|
|
| 52 |
|
$matches = $this->CrawlerDetect->getMatches(); |
| 53 |
|
|
| 54 |
|
$this->assertEquals($this->CrawlerDetect->getMatches(), 'monitoring', $matches); |
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
/** @test */ |
| 58 |
|
public function it_returns_null_when_no_bot_detected() |
|
@@ 58-65 (lines=8) @@
|
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
/** @test */ |
| 58 |
|
public function it_returns_null_when_no_bot_detected() |
| 59 |
|
{ |
| 60 |
|
$test = $this->CrawlerDetect->isCrawler('nothing to see here'); |
| 61 |
|
|
| 62 |
|
$matches = $this->CrawlerDetect->getMatches(); |
| 63 |
|
|
| 64 |
|
$this->assertEquals($this->CrawlerDetect->getMatches(), null, $matches); |
| 65 |
|
} |
| 66 |
|
|
| 67 |
|
/** @test */ |
| 68 |
|
public function empty_user_agent() |