EndpointTest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 13
c 1
b 0
f 0
dl 0
loc 39
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetConsultEndpointUrl() 0 5 1
A testCreateAndSetEndpoint() 0 9 1
A testGetCaptureEndpointUrl() 0 5 1
A testGetCancelEndpointUrl() 0 5 1
A testGetPaymentEndpointUrl() 0 5 1
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