IpagTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 9
c 2
b 0
f 0
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testSetEndpointAfterCreate() 0 9 1
A testCreateAndSetAuthentication() 0 9 1
1
<?php
2
3
namespace Tests;
4
5
use Ipag\Classes\Authentication;
6
use Ipag\Classes\Endpoint;
7
use Ipag\Ipag;
8
use PHPUnit\Framework\TestCase;
9
10
class IpagTest extends TestCase
11
{
12
    public function testCreateAndSetAuthentication()
13
    {
14
        $ipag = new Ipag(new Authentication('[email protected]'), Endpoint::SANDBOX);
15
16
        $this->assertEquals('[email protected]', $ipag->getAuthentication()->getIdentification());
17
18
        $ipag->setAuthentication(new Authentication('[email protected]'));
19
20
        $this->assertEquals('[email protected]', $ipag->getAuthentication()->getIdentification());
21
    }
22
23
    public function testSetEndpointAfterCreate()
24
    {
25
        $ipag = new Ipag(new Authentication('[email protected]'), Endpoint::SANDBOX);
26
27
        $this->assertEquals(Endpoint::SANDBOX, $ipag->getEndpoint()->getUrl());
28
29
        $ipag->setEndpoint(new Endpoint(Endpoint::PRODUCTION));
30
31
        $this->assertEquals(Endpoint::PRODUCTION, $ipag->getEndpoint()->getUrl());
32
    }
33
}
34