Passed
Push — master ( a42d4d...b40d8f )
by Ross
02:40
created

CurrentIpTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A canReturnTheCurrentIpAddress() 0 7 1
1
<?php declare(strict_types = 1);
2
/**
3
 *
4
 * Copyright (C) 2018  Ross Mitchell
5
 *
6
 * This file is part of RossMitchell/UpdateCloudFlare.
7
 *
8
 * RossMitchell/UpdateCloudFlare is free software: you can redistribute
9
 * it and/or modify it under the terms of the GNU General Public License
10
 * as published by the Free Software Foundation, either version 3 of the
11
 * License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
 */
21
22
namespace RossMitchell\UpdateCloudFlare\Tests\Model\Requests;
23
24
use RossMitchell\UpdateCloudFlare\Model\Requests\CurrentIpAddress;
25
use RossMitchell\UpdateCloudFlare\Tests\AbstractTestClass;
26
use RossMitchell\UpdateCloudFlare\Tests\Fakes\Curl;
27
28
class CurrentIpTest extends AbstractTestClass
29
{
30
    /**
31
     * @Inject
32
     * @var CurrentIpAddress
33
     */
34
    private $currentIp;
35
36
    /**
37
     * @Inject
38
     * @var Curl
39
     */
40
    private $curl;
41
42
    /**
43
     * @test
44
     */
45
    public function canReturnTheCurrentIpAddress()
46
    {
47
        $expectedIpAddress = '1.2.3.4';
48
        $this->curl->setResponse($expectedIpAddress);
49
        $actualIpAddress = $this->currentIp->getCurrentIpAddress();
50
51
        $this->assertEquals($expectedIpAddress, $actualIpAddress);
52
    }
53
}
54