Passed
Push — master ( d7fd0c...0cd2cd )
by Sam
04:33
created

ClassEnumTest::testGetClassFromName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
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