EndpointTest::testCreateAndSetEndpoint()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 9
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Tests\Classes;
4
5
use Ipag\Classes\Endpoint;
6
use PHPUnit\Framework\TestCase;
7
8
class EndpointTest extends TestCase
9
{
10
    public function testCreateAndSetEndpoint()
11
    {
12
        $endpoint = new Endpoint(Endpoint::SANDBOX);
13
14
        $this->assertEquals($endpoint->getUrl(), Endpoint::SANDBOX);
15
16
        $endpoint->setUrl(Endpoint::PRODUCTION);
17
18
        $this->assertEquals($endpoint->getUrl(), Endpoint::PRODUCTION);
19
    }
20
21
    public function testGetPaymentEndpointUrl()
22
    {
23
        $endpoint = new Endpoint(Endpoint::SANDBOX);
24
25
        $this->assertEquals($endpoint->payment(), Endpoint::SANDBOX.Endpoint::PAYMENT);
26
    }
27
28
    public function testGetConsultEndpointUrl()
29
    {
30
        $endpoint = new Endpoint(Endpoint::SANDBOX);
31
32
        $this->assertEquals($endpoint->consult(), Endpoint::SANDBOX.Endpoint::CONSULT);
33
    }
34
35
    public function testGetCancelEndpointUrl()
36
    {
37
        $endpoint = new Endpoint(Endpoint::SANDBOX);
38
39
        $this->assertEquals($endpoint->cancel(), Endpoint::SANDBOX.Endpoint::CANCEL);
40
    }
41
42
    public function testGetCaptureEndpointUrl()
43
    {
44
        $endpoint = new Endpoint(Endpoint::SANDBOX);
45
46
        $this->assertEquals($endpoint->CAPTURE(), Endpoint::SANDBOX.Endpoint::CAPTURE);
47
    }
48
}
49