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.

TimeInTransitTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
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\TimeInTransitWrapper;
15
16
class TimeInTransitTest extends \PHPUnit_Framework_TestCase
17
{
18
    /**
19
     * @var
20
     */
21
    private $timeInTransitMock;
22
23
    public function setUp()
24
    {
25
        $this->timeInTransitMock = $this->getMock('Ups\TimeInTransit');
26
    }
27
28
    /**
29
     * when: getTimeInTransitIsCalled
30
     * should: callUpsTimeInTransitGetTimeInTransitMethod.
31
     */
32
    public function testTimeInTransitGetTimeInTransitMethodIsCalled()
33
    {
34
        $timeInTransitRequestMock = $this->getMock('Ups\Entity\TimeInTransitRequest');
35
        $this->timeInTransitMock
36
            ->expects($this->once())
37
            ->method('getTimeInTransit')
38
            ->with($timeInTransitRequestMock);
39
40
        $sut = new TimeInTransitWrapper($this->timeInTransitMock);
41
42
        $sut->getTimeInTransit($timeInTransitRequestMock);
43
    }
44
45
    /**
46
     * when: getRequestIsCalled
47
     * should: callUpsTimeInTransitGetRequestMethod.
48
     */
49
    public function testTimeInTransitGetRequestMethodIsCalled()
50
    {
51
        $requestMock = $this->getMock('Ups\Request');
52
        $this
53
            ->timeInTransitMock
54
            ->method('getRequest')
55
            ->willReturn($requestMock);
56
57
        $sut = new TimeInTransitWrapper($this->timeInTransitMock);
58
        $sut->setRequest($requestMock);
59
        $request = $sut->getRequest();
60
        $this->assertInstanceOf('Ups\Request', $request);
61
    }
62
63
    /**
64
     * when: getResponseIsCalled
65
     * should: callUpsTimeInTransitGetResponseMethod.
66
     */
67 View Code Duplication
    public function testTimeInTransitGetResponseMethodIsCalled()
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...
68
    {
69
        $responseMock = $this->getMock('Ups\Response');
70
        $this
71
            ->timeInTransitMock
72
            ->method('getResponse')
73
            ->willReturn($responseMock);
74
75
        $sut = new TimeInTransitWrapper($this->timeInTransitMock);
76
        $sut->setResponse($responseMock);
77
        $response = $sut->getResponse();
78
        $this->assertInstanceOf('Ups\Response', $response);
79
    }
80
}
81