KrsTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 33
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testKrsValid() 0 6 1
A testCreate() 0 5 1
A testKrsInvalid() 0 4 1
A testKrsEmpty() 0 4 1
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\Krs;
18
19
class KrsTest extends TestCase
20
{
21
    public function testKrsValid()
22
    {
23
        $defNr = '311911';
24
        $res   = new Krs($defNr);
25
        $this->assertEquals('0000311911', $res->get());
26
    }
27
28
    public function testCreate()
29
    {
30
        $res = Krs::create('0012345678');
31
        $this->assertEquals('0012345678', $res->get());
32
    }
33
34
35
    /**
36
     * @expectedException \mrcnpdlk\Validator\Exception
37
     */
38
    public function testKrsInvalid()
39
    {
40
        new Krs('000031d1911');
41
    }
42
43
    /**
44
     * @expectedException \mrcnpdlk\Validator\Exception
45
     */
46
    public function testKrsEmpty()
47
    {
48
        new Krs('');
49
    }
50
51
}
52