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.

testShippingRecoverLabelMethodIsCalled()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 12
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 12
loc 12
rs 9.4285
cc 1
eloc 8
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\ShippingWrapper;
15
16
class ShippingTest extends \PHPUnit_Framework_TestCase
17
{
18
    private $shippingMock;
19
20
    public function setUp()
21
    {
22
        $this->shippingMock = $this->getMock('Ups\Shipping');
23
    }
24
25
    /**
26
     * when: confirmIsCalled
27
     * should: callUpsShippingConfirmMethod.
28
     */
29
    public function testShippingConfirmMethodIsCalled()
30
    {
31
        $validationString = 'validationString';
32
        $shipmentMock = $this->getMockBuilder('Ups\Entity\Shipment')
33
            ->disableOriginalConstructor()
34
            ->getMock();
35
        $labelSpecMock = $this->getMockBuilder('Ups\Entity\ShipmentRequestLabelSpecification')
36
            ->disableOriginalConstructor()
37
            ->getMock();
38
        $receiptSpecMock = $this->getMockBuilder('Ups\Entity\ShipmentRequestReceiptSpecification')
39
            ->disableOriginalConstructor()
40
            ->getMock();
41
42
        $this->shippingMock
43
            ->expects($this->once())
44
            ->method('confirm')
45
            ->with(
46
                $validationString,
47
                $shipmentMock,
48
                $labelSpecMock,
49
                $receiptSpecMock
50
            );
51
52
        $sut = new ShippingWrapper($this->shippingMock);
53
54
        $sut->confirm(
55
            'validationString',
56
            $shipmentMock,
57
            $labelSpecMock,
58
            $receiptSpecMock
59
        );
60
    }
61
62
    /**
63
     * when: acceptIsCalled
64
     * should: callUpsShippingAcceptMethod.
65
     */
66
    public function testShippingAcceptMethodIsCalled()
67
    {
68
        $shipmentDigestString = 'shippmentDigestString';
69
        $this->shippingMock
70
            ->expects($this->once())
71
            ->method('accept')
72
            ->with($shipmentDigestString);
73
74
        $sut = new ShippingWrapper($this->shippingMock);
75
76
        $sut->accept($shipmentDigestString);
77
    }
78
79
    /**
80
     * when: voidIsCalled
81
     * should: callUpsShippingVoidRequestMethod.
82
     */
83 View Code Duplication
    public function testShippingVoidMethodIsCalled()
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...
84
    {
85
        $shipmentDataString = 'shippmentDataString';
86
        $this->shippingMock
87
            ->expects($this->once())
88
            ->method('void')
89
            ->with($shipmentDataString);
90
91
        $sut = new ShippingWrapper($this->shippingMock);
92
93
        $sut->void($shipmentDataString);
94
    }
95
96
    /**
97
     * when: recoverLabelIsCalled
98
     * should: callUpsShippingRecoverLabelRequestMethod.
99
     */
100 View Code Duplication
    public function testShippingRecoverLabelMethodIsCalled()
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...
101
    {
102
        $shipmentDataString = 'shipmentDataString';
103
        $this->shippingMock
104
            ->expects($this->once())
105
            ->method('recoverLabel')
106
            ->with($shipmentDataString);
107
108
        $sut = new ShippingWrapper($this->shippingMock);
109
110
        $sut->recoverLabel($shipmentDataString);
111
    }
112
}
113