Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
40 | public function testWire(): void |
||
41 | { |
||
42 | $host = 'host.example.com.'; |
||
43 | $expectation = chr(4).'host'.chr(7).'example'.chr(3).'com'.chr(0); |
||
44 | |||
45 | /** @var CNAME $cname */ |
||
46 | $cname = new CNAME(); |
||
47 | $cname->fromWire($expectation); |
||
48 | |||
49 | $this->assertEquals($expectation, $cname->toWire()); |
||
50 | $this->assertEquals($host, $cname->getTarget()); |
||
51 | |||
52 | //Test that toWire() will throw an exception if no target is set. |
||
53 | $cname = new CNAME(); |
||
54 | $this->expectException(\InvalidArgumentException::class); |
||
55 | $this->expectExceptionMessage('Target must be set.'); |
||
56 | $cname->toWire(); |
||
57 | } |
||
58 | } |
||
59 |