-
Notifications
You must be signed in to change notification settings - Fork 970
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BWC] Add getHost() method to ConnectionInterface
- Loading branch information
1 parent
a0ddad1
commit 445fdea
Showing
2 changed files
with
7 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -273,11 +273,6 @@ public function testInlineHosts() | |
$client = Elasticsearch\ClientBuilder::create()->setHosts([ | ||
'localhost:9200' | ||
])->build(); | ||
|
||
// We're casting to Connection here, instead of ConnectionInterface | ||
// so we can access getHost() on Connection | ||
|
||
/** @var Connection $host */ | ||
$host = $client->transport->getConnection(); | ||
$this->assertEquals("localhost:9200", $host->getHost()); | ||
$this->assertEquals("http", $host->getTransportSchema()); | ||
|
@@ -286,23 +281,20 @@ public function testInlineHosts() | |
$client = Elasticsearch\ClientBuilder::create()->setHosts([ | ||
'http://localhost:9200' | ||
])->build(); | ||
/** @var Connection $host */ | ||
$host = $client->transport->getConnection(); | ||
$this->assertEquals("localhost:9200", $host->getHost()); | ||
$this->assertEquals("http", $host->getTransportSchema()); | ||
|
||
$client = Elasticsearch\ClientBuilder::create()->setHosts([ | ||
'http://foo.com:9200' | ||
])->build(); | ||
/** @var Connection $host */ | ||
$host = $client->transport->getConnection(); | ||
$this->assertEquals("foo.com:9200", $host->getHost()); | ||
$this->assertEquals("http", $host->getTransportSchema()); | ||
|
||
$client = Elasticsearch\ClientBuilder::create()->setHosts([ | ||
'https://foo.com:9200' | ||
])->build(); | ||
/** @var Connection $host */ | ||
$host = $client->transport->getConnection(); | ||
$this->assertEquals("foo.com:9200", $host->getHost()); | ||
$this->assertEquals("https", $host->getTransportSchema()); | ||
|
@@ -314,7 +306,6 @@ public function testInlineHosts() | |
$client = Elasticsearch\ClientBuilder::create()->setHosts([ | ||
'https://user:[email protected]:9200' | ||
])->build(); | ||
/** @var Connection $host */ | ||
$host = $client->transport->getConnection(); | ||
$this->assertEquals("foo.com:9200", $host->getHost()); | ||
$this->assertEquals("https", $host->getTransportSchema()); | ||
|
@@ -329,7 +320,6 @@ public function testExtendedHosts() | |
'scheme' => 'http' | ||
] | ||
])->build(); | ||
/** @var Connection $host */ | ||
$host = $client->transport->getConnection(); | ||
$this->assertEquals("localhost:9200", $host->getHost()); | ||
$this->assertEquals("http", $host->getTransportSchema()); | ||
|
@@ -342,7 +332,6 @@ public function testExtendedHosts() | |
'scheme' => 'http' | ||
] | ||
])->build(); | ||
/** @var Connection $host */ | ||
$host = $client->transport->getConnection(); | ||
$this->assertEquals("foo.com:9200", $host->getHost()); | ||
$this->assertEquals("http", $host->getTransportSchema()); | ||
|
@@ -355,7 +344,6 @@ public function testExtendedHosts() | |
'scheme' => 'https' | ||
] | ||
])->build(); | ||
/** @var Connection $host */ | ||
$host = $client->transport->getConnection(); | ||
$this->assertEquals("foo.com:9200", $host->getHost()); | ||
$this->assertEquals("https", $host->getTransportSchema()); | ||
|
@@ -367,7 +355,6 @@ public function testExtendedHosts() | |
'scheme' => 'http' | ||
] | ||
])->build(); | ||
/** @var Connection $host */ | ||
$host = $client->transport->getConnection(); | ||
$this->assertEquals("foo.com:9200", $host->getHost()); | ||
$this->assertEquals("http", $host->getTransportSchema()); | ||
|
@@ -378,7 +365,6 @@ public function testExtendedHosts() | |
'host' => 'foo.com' | ||
] | ||
])->build(); | ||
/** @var Connection $host */ | ||
$host = $client->transport->getConnection(); | ||
$this->assertEquals("foo.com:9200", $host->getHost()); | ||
$this->assertEquals("http", $host->getTransportSchema()); | ||
|
@@ -391,7 +377,6 @@ public function testExtendedHosts() | |
'scheme' => 'https' | ||
] | ||
])->build(); | ||
/** @var Connection $host */ | ||
$host = $client->transport->getConnection(); | ||
$this->assertEquals("foo.com:9500", $host->getHost()); | ||
$this->assertEquals("https", $host->getTransportSchema()); | ||
|
@@ -415,7 +400,6 @@ public function testExtendedHosts() | |
'host' => 'the_foo.com' | ||
] | ||
])->build(); | ||
/** @var Connection $host */ | ||
$host = $client->transport->getConnection(); | ||
$this->assertEquals("the_foo.com:9200", $host->getHost()); | ||
$this->assertEquals("http", $host->getTransportSchema()); | ||
|
@@ -429,7 +413,6 @@ public function testExtendedHosts() | |
'pass' => 'abc#$%!abc' | ||
] | ||
])->build(); | ||
/** @var Connection $host */ | ||
$host = $client->transport->getConnection(); | ||
$this->assertEquals("foo.com:9200", $host->getHost()); | ||
$this->assertEquals("http", $host->getTransportSchema()); | ||
|