Completed
Push — master ( 666d36...a3ce9d )
by Sam
02:53
created

CaaRdataTest::testGetType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of Badcow DNS Library.
5
 *
6
 * (c) Samuel Williams <[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 Badcow\DNS\Tests\Rdata;
13
14
use Badcow\DNS\Rdata\CAA;
15
use Badcow\DNS\Rdata\Factory;
16
17
class CaaRdataTest extends \PHPUnit\Framework\TestCase
18
{
19
    public function testOutput()
20
    {
21
        $caa = Factory::Caa(0, 'issue', 'letsencrypt.org');
22
23
        $expectation = '0 issue "letsencrypt.org"';
24
25
        $this->assertEquals($expectation, $caa->output());
26
        $this->assertEquals(0, $caa->getFlag());
27
        $this->assertEquals('issue', $caa->getTag());
28
    }
29
30
    /**
31
     * @expectedException \InvalidArgumentException
32
     */
33
    public function testFlagException()
34
    {
35
        $srv = new CAA();
36
        $srv->setFlag(CAA::MAX_FLAG + 1);
37
    }
38
39
    /**
40
     * @expectedException \InvalidArgumentException
41
     */
42
    public function testTagException()
43
    {
44
        $srv = new CAA();
45
        $srv->setTag('not_exist');
46
    }
47
48
    public function testGetType()
49
    {
50
        $this->assertEquals('CAA', (new CAA())->getType());
51
    }
52
}
53