1
0
mirror of https://github.com/danog/dns.git synced 2024-11-30 04:29:06 +01:00

Fix BasicResolver::reloadConfig

This commit is contained in:
Niklas Keller 2017-06-23 18:43:04 +02:00
parent a10643fa37
commit 015ac39f08
2 changed files with 13 additions and 1 deletions

View File

@ -236,7 +236,7 @@ class BasicResolver implements Resolver {
*/
public function reloadConfig(): Promise {
return call(function () {
$this->config = $this->configLoader->loadConfig();
$this->config = yield $this->configLoader->loadConfig();
});
}

View File

@ -27,6 +27,18 @@ class IntegrationTest extends TestCase {
});
}
/**
* @param string $hostname
* @group internet
*/
public function testWorksAfterConfigReload() {
Loop::run(function () {
yield Dns\query("google.com", Record::A);
$this->assertNull(yield Dns\resolver()->reloadConfig());
$this->assertInternalType("array", yield Dns\query("example.com", Record::A));
});
}
public function testResolveIPv4only() {
Loop::run(function () {
$records = yield Dns\resolve("google.com", Record::A);