Code Duplication    Length = 13-14 lines in 3 locations

tests/Rdata/AfsdbTest.php 1 location

@@ 66-79 (lines=14) @@
63
        $this->assertEquals('foo.example.com.', $afsdb->getHostname());
64
    }
65
66
    public function testWire(): void
67
    {
68
        $afsdb = new AFSDB();
69
        $afsdb->setHostname('foo.example.com.');
70
        $afsdb->setSubType(2);
71
72
        $expectation = pack('n', 2).chr(3).'foo'.chr(7).'example'.chr(3).'com'.chr(0);
73
74
        $fromWire = new AFSDB();
75
        $fromWire->fromWire($expectation);
76
77
        $this->assertEquals($expectation, $afsdb->toWire());
78
        $this->assertEquals($afsdb, $fromWire);
79
    }
80
81
    public function testFactory(): void
82
    {

tests/Rdata/KxTest.php 1 location

@@ 82-94 (lines=13) @@
79
        $this->assertEquals('mail.example.com.', $kx->getExchanger());
80
    }
81
82
    public function testWire(): void
83
    {
84
        $kx = new KX();
85
        $kx->setExchanger('mail.example.com.');
86
        $kx->setPreference(10);
87
88
        $expectation = pack('n', 10).chr(4).'mail'.chr(7).'example'.chr(3).'com'.chr(0);
89
90
        $this->assertEquals($expectation, $kx->toWire());
91
        $fromWire = new KX();
92
        $fromWire->fromWire($expectation);
93
        $this->assertEquals($kx, $fromWire);
94
    }
95
}
96

tests/Rdata/MxTest.php 1 location

@@ 74-86 (lines=13) @@
71
        $this->assertEquals('mail.example.com.', $mx->getExchange());
72
    }
73
74
    public function testWire(): void
75
    {
76
        $mx = new MX();
77
        $mx->setExchange('mail.example.com.');
78
        $mx->setPreference(10);
79
80
        $expectation = pack('n', 10).chr(4).'mail'.chr(7).'example'.chr(3).'com'.chr(0);
81
82
        $this->assertEquals($expectation, $mx->toWire());
83
        $fromWire = new MX();
84
        $fromWire->fromWire($expectation);
85
        $this->assertEquals($mx, $fromWire);
86
    }
87
}
88