ClassEnumTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 8
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetClassFromName() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of PHP DNS Server.
5
 *
6
 * (c) Yif Swery <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace yswery\DNS\Tests;
13
14
use PHPUnit\Framework\TestCase;
15
use yswery\DNS\ClassEnum;
16
17
class ClassEnumTest extends TestCase
18
{
19
    public function testGetClassFromName()
20
    {
21
        $this->assertEquals(ClassEnum::HESIOD, ClassEnum::getClassFromName('HS'));
22
        $this->assertEquals(ClassEnum::CHAOS, ClassEnum::getClassFromName('chaos'));
23
        $this->expectException(\InvalidArgumentException::class);
24
        ClassEnum::getClassFromName('NO');
25
    }
26
}
27