@@ 66-103 (lines=38) @@ | ||
63 | $this->expectedIpv6Record = str_replace("\r", '', $this->expectedIpv6Record); |
|
64 | } |
|
65 | ||
66 | public function testReverseIpv4Record(): void |
|
67 | { |
|
68 | $origin = PTR::reverseIpv4('192.168.8'); |
|
69 | ||
70 | $soa = ResourceRecord::create('@', Factory::SOA( |
|
71 | 'example.com.', |
|
72 | 'post.example.com.', |
|
73 | 2015010101, |
|
74 | 3600, |
|
75 | 14400, |
|
76 | 604800, |
|
77 | 3600 |
|
78 | ), null, Classes::INTERNET); |
|
79 | ||
80 | $ns1 = ResourceRecord::create('@', Factory::NS('ns1.example.com.'), null, Classes::INTERNET); |
|
81 | $ns2 = ResourceRecord::create('@', Factory::NS('ns2.example.com.'), null, Classes::INTERNET); |
|
82 | ||
83 | $foo1 = ResourceRecord::create('1', Factory::PTR('foo1.example.com.'), null, Classes::INTERNET); |
|
84 | $foo2 = ResourceRecord::create('2', Factory::PTR('foo2.example.com.'), null, Classes::INTERNET); |
|
85 | $foo3 = ResourceRecord::create('3', Factory::PTR('foo3.example.com.'), null, Classes::INTERNET); |
|
86 | $foo4 = ResourceRecord::create('4', Factory::PTR('foo4.example.com.'), null, Classes::INTERNET); |
|
87 | $foo5 = ResourceRecord::create('5', Factory::PTR('foo5.example.com.'), null, Classes::INTERNET); |
|
88 | ||
89 | $zone = new Zone($origin, 14400, [ |
|
90 | $soa, |
|
91 | $ns1, |
|
92 | $ns2, |
|
93 | $foo1, |
|
94 | $foo2, |
|
95 | $foo3, |
|
96 | $foo4, |
|
97 | $foo5, |
|
98 | ]); |
|
99 | ||
100 | $builder = new ZoneBuilder(); |
|
101 | ||
102 | $this->assertEquals($this->expectedIpv4Record, $builder->build($zone)); |
|
103 | } |
|
104 | ||
105 | public function testReverseIpv6Record(): void |
|
106 | { |
|
@@ 105-142 (lines=38) @@ | ||
102 | $this->assertEquals($this->expectedIpv4Record, $builder->build($zone)); |
|
103 | } |
|
104 | ||
105 | public function testReverseIpv6Record(): void |
|
106 | { |
|
107 | $origin = PTR::reverseIpv6('2001:f83:21'); |
|
108 | ||
109 | $soa = ResourceRecord::create('@', Factory::SOA( |
|
110 | 'example.com.', |
|
111 | 'post.example.com.', |
|
112 | 2015010101, |
|
113 | 3600, |
|
114 | 14400, |
|
115 | 604800, |
|
116 | 3600 |
|
117 | ), null, Classes::INTERNET); |
|
118 | ||
119 | $ns1 = ResourceRecord::create('@', Factory::NS('ns1.example.com.'), null, Classes::INTERNET); |
|
120 | $ns2 = ResourceRecord::create('@', Factory::NS('ns2.example.com.'), null, Classes::INTERNET); |
|
121 | ||
122 | $foo8 = ResourceRecord::create('8', Factory::PTR('foo8.example.com.'), null, Classes::INTERNET); |
|
123 | $foo9 = ResourceRecord::create('9', Factory::PTR('foo9.example.com.'), null, Classes::INTERNET); |
|
124 | $fooa = ResourceRecord::create('a', Factory::PTR('fooa.example.com.'), null, Classes::INTERNET); |
|
125 | $foob = ResourceRecord::create('b', Factory::PTR('foob.example.com.'), null, Classes::INTERNET); |
|
126 | $fooc = ResourceRecord::create('c', Factory::PTR('fooc.example.com.'), null, Classes::INTERNET); |
|
127 | ||
128 | $zone = new Zone($origin, 14400, [ |
|
129 | $soa, |
|
130 | $ns1, |
|
131 | $ns2, |
|
132 | $foo8, |
|
133 | $foo9, |
|
134 | $fooa, |
|
135 | $foob, |
|
136 | $fooc, |
|
137 | ]); |
|
138 | ||
139 | $builder = new ZoneBuilder(); |
|
140 | ||
141 | $this->assertEquals($this->expectedIpv6Record, $builder->build($zone)); |
|
142 | } |
|
143 | } |
|
144 |