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

MxRdataTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testSetters() 0 11 1
A testOutput() 0 9 1
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