Completed
Push — master ( b8a8af...689cd9 )
by Mark
04:55
created

UserAgentTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
class UserAgentTest extends PHPUnit_Framework_TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
    protected $CrawlerDetect;
6
7
    public function setUp()
8
    {
9
        $this->CrawlerDetect = new Jaybizzle\CrawlerDetect\CrawlerDetect();
10
    }
11
12
    public function testBots()
13
    {
14
        $lines = file(__DIR__.'/crawlers.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected ')'
Loading history...
15
16
        foreach ($lines as $line) {
17
            $test = $this->CrawlerDetect->isCrawler($line);
18
            $this->assertEquals($test, true, $line);
19
        }
20
    }
21
22
    public function testDevices()
23
    {
24
        $lines = file(__DIR__.'/devices.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
25
26
        foreach ($lines as $line) {
27
            $test = $this->CrawlerDetect->isCrawler($line);
28
            $this->assertEquals($test, false, $line);
29
        }
30
    }
31
}
32