2017-06-29 12:36:09 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Amp\Dns\Test;
|
|
|
|
|
|
|
|
use Amp\Dns;
|
|
|
|
use Amp\Promise;
|
|
|
|
use function Amp\Promise\wait;
|
|
|
|
|
2019-01-25 02:27:47 +01:00
|
|
|
class UdpSocketTest extends SocketTest
|
|
|
|
{
|
|
|
|
protected function connect(): Promise
|
|
|
|
{
|
2017-06-29 12:36:09 +02:00
|
|
|
return Dns\Internal\UdpSocket::connect("udp://8.8.8.8:53");
|
|
|
|
}
|
|
|
|
|
2019-01-25 02:27:47 +01:00
|
|
|
public function testInvalidUri()
|
|
|
|
{
|
2019-01-04 18:20:52 +01:00
|
|
|
$this->expectException(Dns\DnsException::class);
|
2017-06-29 12:36:09 +02:00
|
|
|
wait(Dns\Internal\UdpSocket::connect("udp://8.8.8.8"));
|
|
|
|
}
|
|
|
|
}
|