|
@@ 33-42 (lines=10) @@
|
| 30 |
|
} |
| 31 |
|
|
| 32 |
|
/** @test */ |
| 33 |
|
public function user_agents_are_devices() |
| 34 |
|
{ |
| 35 |
|
$this->CrawlerDetect = new CrawlerDetect(); |
| 36 |
|
$lines = file(__DIR__.'/devices.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
| 37 |
|
|
| 38 |
|
foreach ($lines as $line) { |
| 39 |
|
$test = $this->CrawlerDetect->isCrawler($line); |
| 40 |
|
$this->assertFalse($test, $line); |
| 41 |
|
} |
| 42 |
|
} |
| 43 |
|
|
| 44 |
|
/** @test */ |
| 45 |
|
public function it_returns_correct_matched_bot_name() |
|
@@ 21-30 (lines=10) @@
|
| 18 |
|
public $CrawlerDetect; |
| 19 |
|
|
| 20 |
|
/** @test */ |
| 21 |
|
public function user_agents_are_bots() |
| 22 |
|
{ |
| 23 |
|
$this->CrawlerDetect = new CrawlerDetect(); |
| 24 |
|
$lines = file(__DIR__.'/crawlers.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
| 25 |
|
|
| 26 |
|
foreach ($lines as $line) { |
| 27 |
|
$test = $this->CrawlerDetect->isCrawler($line); |
| 28 |
|
$this->assertTrue($test, $line); |
| 29 |
|
} |
| 30 |
|
} |
| 31 |
|
|
| 32 |
|
/** @test */ |
| 33 |
|
public function user_agents_are_devices() |