diff --git a/test/BasicResolverTest.php b/test/BasicResolverTest.php new file mode 100644 index 0000000..c01e131 --- /dev/null +++ b/test/BasicResolverTest.php @@ -0,0 +1,32 @@ +expectException(\Error::class); + (new BasicResolver)->resolve("abc.de", Record::TXT); + }); + } + + public function testIpAsArgumentWithIPv4Restriction() { + Loop::run(function () { + $this->expectException(ResolutionException::class); + yield (new BasicResolver)->resolve("::1", Record::A); + }); + } + + public function testIpAsArgumentWithIPv6Restriction() { + Loop::run(function () { + $this->expectException(ResolutionException::class); + yield (new BasicResolver)->resolve("127.0.0.1", Record::AAAA); + }); + } +} diff --git a/test/IntegrationTest.php b/test/IntegrationTest.php index f329fc1..bbe18c6 100644 --- a/test/IntegrationTest.php +++ b/test/IntegrationTest.php @@ -20,6 +20,7 @@ class IntegrationTest extends TestCase { /** @var Record $record */ $record = $result[0]; $inAddr = @\inet_pton($record->getValue()); + $this->assertNotNull($record->getTtl()); $this->assertNotFalse( $inAddr, "Server name $hostname did not resolve to a valid IP address"