Completed
Push — master ( 72b670...3b819e )
by Sam
05:26 queued 03:37
created

TypesTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetTypeCode() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Badcow DNS Library.
7
 *
8
 * (c) Samuel Williams <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Badcow\DNS\Tests\Rdata;
15
16
use Badcow\DNS\Rdata\Types;
17
use Badcow\DNS\Rdata\UnsupportedTypeException;
18
use PHPUnit\Framework\TestCase;
19
20
class TypesTest extends TestCase
21
{
22
    /**
23
     * @throws UnsupportedTypeException
24
     */
25
    public function testGetTypeCode(): void
26
    {
27
        $this->assertEquals(1, Types::getTypeCode('A'));
28
        $this->assertEquals(1234, Types::getTypeCode('TYPE1234'));
29
30
        $this->expectException(UnsupportedTypeException::class);
31
        $this->expectExceptionMessage('RData type "XX" is not supported.');
32
        Types::getTypeCode('XX');
33
    }
34
}
35