GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( a5b504...99f733 )
by Dejan
02:54
created

AgentParser_MacintoshTest::userAgentOsDataProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
namespace Fam\Util\UserAgentParser;
3
4
use PHPUnit\Framework\TestCase;
5
6
class MacintoshTest extends TestCase
7
{
8
    /**
9
     *
10
     * @var Windows
11
     */
12
    private $subject;
13
14
    protected function setUp()
15
    {
16
        parent::setUp();
17
18
        $this->subject = new \Fam\Util\UserAgentParser\Macintosh();
0 ignored issues
show
Documentation Bug introduced by
It seems like new \Fam\Util\UserAgentParser\Macintosh() of type object<Fam\Util\UserAgentParser\Macintosh> is incompatible with the declared type object<Fam\Util\UserAgentParser\Windows> of property $subject.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
19
    }
20
21
    /**
22
     * @test
23
     * @dataProvider userAgentOsDataProvider
24
     */
25
    public function match_WithValidValue($userAgent)
0 ignored issues
show
Coding Style introduced by
Method name "MacintoshTest::match_WithValidValue" is not in camel caps format
Loading history...
26
    {
27
        $this->assertTrue($this->subject->match($userAgent));
28
    }
29
30
    /**
31
     * @test
32
     */
33
    public function match_WithInvalidValue()
0 ignored issues
show
Coding Style introduced by
Method name "MacintoshTest::match_WithInvalidValue" is not in camel caps format
Loading history...
34
    {
35
        $this->assertFalse($this->subject->match("Lynx/2.8.4rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6c"));
36
    }
37
38
    /**
39
     * @test
40
     */
41
    public function getName_returnsMacintosh()
0 ignored issues
show
Coding Style introduced by
Method name "MacintoshTest::getName_returnsMacintosh" is not in camel caps format
Loading history...
42
    {
43
        $this->assertEquals("macintosh", $this->subject->getName());
44
    }
45
46
    public function userAgentOsDataProvider()
47
    {
48
        return [
49
            [
50
                "Mozilla/5.0 (Mac_PowerPC; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8",
51
            ],
52
53
            [
54
                "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8",
55
            ],
56
57
            [
58
                "Mozilla/5.0 (Mac OS X; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8",
59
            ],
60
        ];
61
    }
62
63
}
64