diff --git a/lib/WindowsConfigLoader.php b/lib/WindowsConfigLoader.php index 113ad79..ec89998 100644 --- a/lib/WindowsConfigLoader.php +++ b/lib/WindowsConfigLoader.php @@ -8,6 +8,12 @@ use Amp\WindowsRegistry\WindowsRegistry; use function Amp\call; final class WindowsConfigLoader implements ConfigLoader { + private $hostLoader; + + public function __construct(HostLoader $hostLoader = null) { + $this->hostLoader = $hostLoader ?? new HostLoader; + } + public function loadConfig(): Promise { return call(function () { $keys = [ @@ -67,7 +73,9 @@ final class WindowsConfigLoader implements ConfigLoader { } } - return new Config($nameservers); + $hosts = yield $this->hostLoader->loadHosts(); + + return new Config($nameservers, $hosts); }); } } diff --git a/test/IntegrationTest.php b/test/IntegrationTest.php index c389b95..58a5cca 100644 --- a/test/IntegrationTest.php +++ b/test/IntegrationTest.php @@ -28,7 +28,6 @@ class IntegrationTest extends TestCase { } /** - * @param string $hostname * @group internet */ public function testWorksAfterConfigReload() {