1 | <?php |
||
19 | class RegonTest extends TestCase |
||
20 | { |
||
21 | public function testRegonValid() |
||
22 | { |
||
23 | $defNr = '331501'; |
||
24 | $res = new Regon($defNr); |
||
25 | $this->assertEquals('000331501', $res->get()); |
||
26 | } |
||
27 | |||
28 | public function testRegonLongValid() |
||
29 | { |
||
30 | $defNr = '47051837100020'; |
||
31 | $res = new Regon($defNr); |
||
32 | $this->assertEquals('470518371', $res->getShort()); |
||
33 | $this->assertEquals('47051837100020', $res->getLong()); |
||
34 | } |
||
35 | |||
36 | public function testCreate() |
||
41 | |||
42 | /** |
||
43 | * @expectedException \mrcnpdlk\Validator\Exception |
||
44 | */ |
||
45 | public function testRegonInvalidChecksum() |
||
49 | |||
50 | /** |
||
51 | * @expectedException \mrcnpdlk\Validator\Exception |
||
52 | */ |
||
53 | public function testRegonInvalidRegex() |
||
54 | { |
||
55 | new Regon('0003315021'); |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @expectedException \mrcnpdlk\Validator\Exception |
||
60 | */ |
||
61 | public function testRegonEmpty() |
||
65 | |||
66 | } |
||
67 |