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:
parent
a10643fa37
commit
015ac39f08
@ -236,7 +236,7 @@ class BasicResolver implements Resolver {
|
|||||||
*/
|
*/
|
||||||
public function reloadConfig(): Promise {
|
public function reloadConfig(): Promise {
|
||||||
return call(function () {
|
return call(function () {
|
||||||
$this->config = $this->configLoader->loadConfig();
|
$this->config = yield $this->configLoader->loadConfig();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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() {
|
public function testResolveIPv4only() {
|
||||||
Loop::run(function () {
|
Loop::run(function () {
|
||||||
$records = yield Dns\resolve("google.com", Record::A);
|
$records = yield Dns\resolve("google.com", Record::A);
|
||||||
|
Loading…
Reference in New Issue
Block a user