IpagTest::testCreateAndSetAuthentication()   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;
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