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

MxRdataTest::testSetters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
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\MX;
15
16
class MxRdataTest extends \PHPUnit\Framework\TestCase
17
{
18
    public function testSetters()
19
    {
20
        $target = 'foo.example.com.';
21
        $preference = 10;
22
        $mx = new MX();
23
        $mx->setExchange($target);
24
        $mx->setPreference($preference);
25
26
        $this->assertEquals($target, $mx->getExchange());
27
        $this->assertEquals($preference, $mx->getPreference());
28
    }
29
30
    public function testOutput()
31
    {
32
        $target = 'foo.example.com.';
33
        $mx = new MX();
34
        $mx->SetExchange($target);
35
        $mx->setPreference(42);
36
37
        $this->assertEquals('42 foo.example.com.', $mx->output());
38
    }
39
}
40