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