DKAlgorithmTest::testInvalidNumber()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace LeKoala\Tin\Test;
4
5
use LeKoala\Tin\TINValid;
6
use PHPUnit\Framework\TestCase;
7
8
class DKAlgorithmTest extends TestCase
9
{
10
    const VALID_NUMBER = '010111-1113';
11
    const VALID_NUMBER2 = '010160-1111';
12
    const INVALID_NUMBER_CHECK = '010111-1114';
13
    const INVALID_NUMBER_LENGTH = '010111-11132';
14
    const INVALID_NUMBER_PATTERN = '010260-1111';
15
16
    public function testValidNumber()
17
    {
18
        $this->assertTrue(TINValid::checkTIN('dk', self::VALID_NUMBER));
19
        $this->assertTrue(TINValid::checkTIN('dk', self::VALID_NUMBER2));
20
    }
21
22
    public function testInvalidNumber()
23
    {
24
        $this->assertFalse(TINValid::checkTIN('dk', self::INVALID_NUMBER_CHECK));
25
        $this->assertFalse(TINValid::checkTIN('dk', self::INVALID_NUMBER_LENGTH));
26
        $this->assertFalse(TINValid::checkTIN('dk', self::INVALID_NUMBER_PATTERN));
27
    }
28
}
29