Skip to content

Commit

Permalink
Resolve target hosts against hosts file (localhost etc.)
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Sep 4, 2017
1 parent 691b4d3 commit 1434add
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"evenement/evenement": "^3.0 || ^2.0 || ^1.0",
"react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3",
"react/promise": "^2.0 || ^1.0",
"react/socket": "^1.0 || ^0.8 || ^0.7"
"react/socket": "^1.0 || ^0.8.2"
},
"require-dev": {
"phpunit/phpunit": "^5.0 || ^4.8"
Expand Down
4 changes: 0 additions & 4 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ private function parseUrl($target)
$parts['port'] = '5038';
}

if ($parts['host'] === 'localhost') {
$parts['host'] = '127.0.0.1';
}

return $parts;
}
}
4 changes: 2 additions & 2 deletions tests/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ public function testCreateClientUsesTcpConnectorWithDefaultLocation()
$this->factory->createClient();
}

public function testCreateClientUsesTcpConnectorWithLocalhostLocation()
public function testCreateClientUsesDefaultPortForTcpConnection()
{
$promise = new Promise(function () { });
$this->tcp->expects($this->once())->method('connect')->with('127.0.0.1:5038')->willReturn($promise);
$this->tcp->expects($this->once())->method('connect')->with('localhost:5038')->willReturn($promise);

$this->factory->createClient('localhost');
}
Expand Down

0 comments on commit 1434add

Please sign in to comment.