Completed
Push — master ( fe9f84...fb76d4 )
by Marcin
03:59
created

PeselTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
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
use mrcnpdlk\Validator\Types\Pesel;
18
19
class PeselTest extends TestCase
20
{
21
    public function testPeselValid()
22
    {
23
        $defNr = '12271402999';
24
        $res   = new Pesel($defNr);
25
        $this->assertEquals('12271402999', $res->get());
26
        $this->assertEquals('2012-07-14', $res->getBirthDate());
27
        $this->assertEquals(Pesel::SEX_M, $res->getSex());
28
    }
29
30
    /**
31
     * @expectedException \mrcnpdlk\Validator\Exception
32
     */
33
    public function testPeselInvalid()
34
    {
35
        new Pesel('12271402990');
36
    }
37
38
}
39