diff --git a/composer.json b/composer.json index db074ff..77ced0c 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "amphp/parser": "^1", "amphp/uri": "^0.1", "amphp/windows-registry": "^0.3", - "daverandom/libdns": "^1" + "daverandom/libdns": "^2.0.1" }, "require-dev": { "amphp/phpunit-util": "^1", diff --git a/lib/Internal/Socket.php b/lib/Internal/Socket.php index dc5e7cd..f17ce52 100644 --- a/lib/Internal/Socket.php +++ b/lib/Internal/Socket.php @@ -237,7 +237,7 @@ abstract class Socket { return false; } - $questionRecord = $questionRecords->current(); + $questionRecord = $questionRecords->getIterator()->current(); if ($questionRecord->getClass() !== $question->getClass()) { return false; diff --git a/test/DecodeTest.php b/test/DecodeTest.php new file mode 100644 index 0000000..05ffe14 --- /dev/null +++ b/test/DecodeTest.php @@ -0,0 +1,21 @@ +create(); + $response = $decoder->decode($message); + + $this->assertInstanceOf(Message::class, $response); + } +}