Failed Conditions
Push — master ( 65cf51...40aca8 )
by Adrien
03:16
created

IbanTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testValidIbanMachineFormat() 0 6 1
A testValidIbanHumanFormat() 0 8 1
A testInvalidIban() 0 5 1
1
<?php
2
3
namespace Genkgo\TestCamt\Unit;
4
5
use InvalidArgumentException;
6
use Genkgo\TestCamt\AbstractTestCase;
7
use Genkgo\Camt\Iban;
8
9
class IbanTest extends AbstractTestCase
10
{
11
    public function testValidIbanMachineFormat()
12
    {
13
        $iban = new Iban($expected = "NL91ABNA0417164300");
14
15
        $this->assertEquals($expected, $iban->getIban());
16
        $this->assertEquals($expected, $iban);
17
    }
18
19
    public function testValidIbanHumanFormat()
20
    {
21
        $expected = "NL91ABNA0417164300";
22
23
        $iban = new Iban("IBAN NL91 ABNA 0417 1643 00");
24
25
        $this->assertEquals($expected, $iban->getIban());
26
        $this->assertEquals($expected, $iban);
27
    }
28
29
    public function testInvalidIban()
30
    {
31
        $this->expectException(InvalidArgumentException::class);
32
33
        new Iban("NL91ABNA0417164301");
34
    }
35
}
36