@@ -180,21 +180,30 @@ public function testToBinaryForResponseWithSOARecord()
180180 public function testToBinaryForResponseWithMultipleAnswerRecords ()
181181 {
182182 $ data = "" ;
183- $ data .= "72 62 01 00 00 01 00 04 00 00 00 00 " ; // header
183+ $ data .= "72 62 01 00 00 01 00 05 00 00 00 00 " ; // header
184184 $ data .= "04 69 67 6f 72 02 69 6f 00 " ; // question: igor.io
185185 $ data .= "00 ff 00 01 " ; // question: type ANY, class IN
186+
186187 $ data .= "04 69 67 6f 72 02 69 6f 00 " ; // answer: igor.io
187188 $ data .= "00 01 00 01 00 00 00 00 00 04 " ; // answer: type A, class IN, TTL 0, 4 bytes
188189 $ data .= "7f 00 00 01 " ; // answer: 127.0.0.1
190+
189191 $ data .= "04 69 67 6f 72 02 69 6f 00 " ; // answer: igor.io
190192 $ data .= "00 1c 00 01 00 00 00 00 00 10 " ; // question: type AAAA, class IN, TTL 0, 16 bytes
191193 $ data .= "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 " ; // answer: ::1
194+
192195 $ data .= "04 69 67 6f 72 02 69 6f 00 " ; // answer: igor.io
193196 $ data .= "00 10 00 01 00 00 00 00 00 0c " ; // answer: type TXT, class IN, TTL 0, 12 bytes
194197 $ data .= "05 68 65 6c 6c 6f 05 77 6f 72 6c 64 " ; // answer: hello, world
198+
195199 $ data .= "04 69 67 6f 72 02 69 6f 00 " ; // answer: igor.io
196- $ data .= "00 0f 00 01 00 00 00 00 00 03 " ; // anwser: type MX, class IN, TTL 0, 3 bytes
197- $ data .= "00 00 00 " ; // priority 0, no target
200+ $ data .= "00 0f 00 01 00 00 00 00 00 03 " ; // answer: type MX, class IN, TTL 0, 3 bytes
201+ $ data .= "00 00 00 " ; // answer: … priority 0, no target
202+
203+ $ data .= "04 69 67 6f 72 02 69 6f 00 " ; // answer: igor.io …
204+ $ data .= "01 01 00 01 00 00 00 00 00 16 " ; // answer: type CAA, class IN, TTL 0, 22 bytes
205+ $ data .= "00 05 69 73 73 75 65 " ; // answer: 0 issue …
206+ $ data .= "6c 65 74 73 65 6e 63 72 79 70 74 2e 6f 72 67 " ; // answer: … letsencrypt.org
198207
199208 $ expected = $ this ->formatHexDump ($ data );
200209
@@ -213,6 +222,7 @@ public function testToBinaryForResponseWithMultipleAnswerRecords()
213222 $ response ->answers [] = new Record ('igor.io ' , Message::TYPE_AAAA , Message::CLASS_IN , 0 , '::1 ' );
214223 $ response ->answers [] = new Record ('igor.io ' , Message::TYPE_TXT , Message::CLASS_IN , 0 , array ('hello ' , 'world ' ));
215224 $ response ->answers [] = new Record ('igor.io ' , Message::TYPE_MX , Message::CLASS_IN , 0 , array ('priority ' => 0 , 'target ' => '' ));
225+ $ response ->answers [] = new Record ('igor.io ' , Message::TYPE_CAA , Message::CLASS_IN , 0 , array ('flag ' => 0 , 'tag ' => 'issue ' , 'value ' => 'letsencrypt.org ' ));
216226
217227 $ dumper = new BinaryDumper ();
218228 $ data = $ dumper ->toBinary ($ response );
0 commit comments