Completed
Push — master ( 3ced6b...53bd9f )
by Marcin
01:36
created

IDCardTest::testCreate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
/**
3
 * Validator
4
 *
5
 * Copyright (c) 2017 pudelek.org.pl
6
 *
7
 * @license MIT License (MIT)
8
 *
9
 * For the full copyright and license information, please view source file
10
 * that is bundled with this package in the file LICENSE
11
 *
12
 * @author  Marcin Pudełek <[email protected]>
13
 */
14
15
namespace mrcnpdlk\Validator;
16
17
18
use mrcnpdlk\Validator\Types\IDCard;
19
20
class IDCardTest extends TestCase
21
{
22
    public function testIDCardValid()
23
    {
24
        $defNr = 'aha 051591  ';
25
        $res   = new IDCard($defNr);
26
        $this->assertEquals('AHA051591', $res->get());
27
    }
28
29
    public function testCreate()
30
    {
31
        $res = IDCard::create('AMD496662');
32
        $this->assertEquals('AMD496662', $res->get());
33
    }
34
35
    /**
36
     * @expectedException \mrcnpdlk\Validator\Exception
37
     */
38
    public function testIDCardInvalid()
39
    {
40
        new IDCard('AHA051590');
41
    }
42
43
}
44