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.
Completed
Push — master ( 041dd4...6e20d0 )
by Jan-Petter
01:50
created

ExportTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 33
loc 33
rs 10

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
namespace vipnytt\UserAgentParser\Tests;
3
4
use vipnytt\UserAgentParser;
5
6
/**
7
 * Class ExportTest
8
 *
9
 * @package vipnytt\UserAgentParser\Tests
10
 */
11
class ExportTest extends \PHPUnit_Framework_TestCase
12
{
13
    /**
14
     * @dataProvider generateDataForTest
15
     * @param string $userAgent
16
     * @param array $result
17
     */
18
    public function testExport($userAgent, $result)
19
    {
20
        $parser = new UserAgentParser($userAgent);
21
        $this->assertInstanceOf('vipnytt\UserAgentParser', $parser);
22
        $this->assertTrue($parser->export() == $result);
23
    }
24
25
    /**
26
     * Generate test data
27
     * @return array
28
     */
29
    public
30
    function generateDataForTest()
31
    {
32
        return [
33
            [
34
                'googlebot-news/2.1',
35
                [
36
                    'googlebot-news/2.1',
37
                    'googlebot-news',
38
                    'googlebot',
39
                ]
40
            ]
41
        ];
42
    }
43
}
44