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 ( fc84de...edddc7 )
by Maxime
02:55
created

SerializerTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 85.71 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 36
loc 42
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testCollectionWithDefaultResourceKey() 9 9 1
A testCollectionWithCustomResourceKey() 9 9 1
A testItemWithDefaultResourceKey() 9 9 1
A testITemWithCustomResourceKey() 9 9 1

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
3
namespace EllipseSynergie\ApiResponse\Tests\Serializer;
4
5
use EllipseSynergie\ApiResponse\Serializer\Serializer;
6
use PHPUnit_Framework_TestCase;
7
8
/**
9
 * Class SerializerTest
10
 * @package EllipseSynergie\ApiResponse\Tests\Serializer
11
 */
12
class SerializerTest extends PHPUnit_Framework_TestCase
13
{
14 View Code Duplication
    public function testCollectionWithDefaultResourceKey()
15
    {
16
        $serializer = new Serializer();
17
        $result = $serializer->collection(null, ['foo']);
18
19
        $this->assertSame([
20
            'data' => ['foo']
21
        ], $result);
22
    }
23
24 View Code Duplication
    public function testCollectionWithCustomResourceKey()
25
    {
26
        $serializer = new Serializer();
27
        $result = $serializer->collection('custom', ['foo']);
28
29
        $this->assertSame([
30
            'custom' => ['foo']
31
        ], $result);
32
    }
33
34 View Code Duplication
    public function testItemWithDefaultResourceKey()
35
    {
36
        $serializer = new Serializer();
37
        $result = $serializer->item(null, ['foo']);
38
39
        $this->assertSame([
40
            'data' => ['foo']
41
        ], $result);
42
    }
43
44 View Code Duplication
    public function testITemWithCustomResourceKey()
45
    {
46
        $serializer = new Serializer();
47
        $result = $serializer->collection('custom', ['foo']);
48
49
        $this->assertSame([
50
            'custom' => ['foo']
51
        ], $result);
52
    }
53
}
54