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.

TrackingTest::testTrackingGetTrackMethodIsCalled()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 13

Duplication

Lines 19
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 19
loc 19
rs 9.4285
cc 1
eloc 13
nc 1
nop 0
1
<?php
2
3
namespace Octante\UpsAPIBundle\Tests\Unit\Library;
4
5
/*
6
 * This file is part of the UpsAPIBundle package.
7
 *
8
 * (c) Issel Guberna <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
use Octante\UpsAPIBundle\Library\TrackingWrapper;
15
16
class TrackingTest extends \PHPUnit_Framework_TestCase
17
{
18
    /**
19
     * @var
20
     */
21
    private $trackingMock;
22
23
    public function setUp()
24
    {
25
        $this->trackingMock = $this->getMock('Ups\Tracking');
26
    }
27
28
    /**
29
     * when: trackIsCalled
30
     * should: callUpsTrackingTrackMethod.
31
     */
32 View Code Duplication
    public function testTrackingGetTrackMethodIsCalled()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
33
    {
34
        $trackingNumber = 'tracking Number';
35
        $requestOption = 'request Option';
36
        $this->trackingMock
37
            ->expects($this->once())
38
            ->method('track')
39
            ->with(
40
                $trackingNumber,
41
                $requestOption
42
            );
43
44
        $sut = new TrackingWrapper($this->trackingMock);
45
46
        $sut->track(
47
            $trackingNumber,
48
            $requestOption
49
        );
50
    }
51
52
    /**
53
     * when: trackByReferenceIsCalled
54
     * should: callUpsTrackingTrackByReferenceMethod.
55
     */
56 View Code Duplication
    public function testTrackingGetTrackByReferenceMethodIsCalled()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
57
    {
58
        $referenceNumber = 'reference Number';
59
        $requestOption = 'request Option';
60
        $this->trackingMock
61
            ->expects($this->once())
62
            ->method('track')
63
            ->with(
64
                $referenceNumber,
65
                $requestOption
66
            );
67
68
        $sut = new TrackingWrapper($this->trackingMock);
69
70
        $sut->track(
71
            $referenceNumber,
72
            $requestOption
73
        );
74
    }
75
76
    /**
77
     * when: getRequestIsCalled
78
     * should: callUpsTrackingGetRequestMethod.
79
     */
80
    public function testTrackingGetGetRequestMethodIsCalled()
81
    {
82
        $requestMock = $this->getMock('Ups\Request');
83
        $this
84
            ->trackingMock
85
            ->method('getRequest')
86
            ->willReturn($requestMock);
87
88
        $sut = new TrackingWrapper($this->trackingMock);
89
        $sut->setRequest($requestMock);
90
        $request = $sut->getRequest();
91
        $this->assertInstanceOf('Ups\Request', $request);
92
    }
93
94
    /**
95
     * when: getResponseIsCalled
96
     * should: callUpsTrackingGetResponseMethod.
97
     */
98 View Code Duplication
    public function testTrackingGetResponseMethodIsCalled()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
99
    {
100
        $responseMock = $this->getMock('Ups\Response');
101
        $this
102
            ->trackingMock
103
            ->method('getResponse')
104
            ->willReturn($responseMock);
105
106
        $sut = new TrackingWrapper($this->trackingMock);
107
        $sut->setResponse($responseMock);
108
        $response = $sut->getResponse();
109
        $this->assertInstanceOf('Ups\Response', $response);
110
    }
111
}
112