Skip to content

Commit ceaaeba

Browse files
authored
Hosts should not have the port in them
Fix tests so that they are no longer checking for the host to have the port in them as welll
1 parent a55adc2 commit ceaaeba

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

tests/Elasticsearch/Tests/ClientTest.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -276,37 +276,37 @@ public function testInlineHosts()
276276
'localhost:9200'
277277
])->build();
278278
$host = $client->transport->getConnection();
279-
$this->assertSame("localhost:9200", $host->getHost());
279+
$this->assertSame("localhost", $host->getHost());
280280
$this->assertSame("http", $host->getTransportSchema());
281281

282282

283283
$client = Elasticsearch\ClientBuilder::create()->setHosts([
284284
'http://localhost:9200'
285285
])->build();
286286
$host = $client->transport->getConnection();
287-
$this->assertSame("localhost:9200", $host->getHost());
287+
$this->assertSame("localhost", $host->getHost());
288288
$this->assertSame("http", $host->getTransportSchema());
289289

290290
$client = Elasticsearch\ClientBuilder::create()->setHosts([
291291
'http://foo.com:9200'
292292
])->build();
293293
$host = $client->transport->getConnection();
294-
$this->assertSame("foo.com:9200", $host->getHost());
294+
$this->assertSame("foo.com", $host->getHost());
295295
$this->assertSame("http", $host->getTransportSchema());
296296

297297
$client = Elasticsearch\ClientBuilder::create()->setHosts([
298298
'https://foo.com:9200'
299299
])->build();
300300
$host = $client->transport->getConnection();
301-
$this->assertSame("foo.com:9200", $host->getHost());
301+
$this->assertSame("foo.com", $host->getHost());
302302
$this->assertSame("https", $host->getTransportSchema());
303303

304304

305305
$client = Elasticsearch\ClientBuilder::create()->setHosts([
306306
'https://user:[email protected]:9200'
307307
])->build();
308308
$host = $client->transport->getConnection();
309-
$this->assertSame("foo.com:9200", $host->getHost());
309+
$this->assertSame("foo.com", $host->getHost());
310310
$this->assertSame("https", $host->getTransportSchema());
311311
$this->assertSame("user:pass", $host->getUserPass());
312312
}
@@ -321,7 +321,7 @@ public function testExtendedHosts()
321321
]
322322
])->build();
323323
$host = $client->transport->getConnection();
324-
$this->assertSame("localhost:9200", $host->getHost());
324+
$this->assertSame("localhost", $host->getHost());
325325
$this->assertSame("http", $host->getTransportSchema());
326326

327327

@@ -333,7 +333,7 @@ public function testExtendedHosts()
333333
]
334334
])->build();
335335
$host = $client->transport->getConnection();
336-
$this->assertSame("foo.com:9200", $host->getHost());
336+
$this->assertSame("foo.com", $host->getHost());
337337
$this->assertSame("http", $host->getTransportSchema());
338338

339339

@@ -345,7 +345,7 @@ public function testExtendedHosts()
345345
]
346346
])->build();
347347
$host = $client->transport->getConnection();
348-
$this->assertSame("foo.com:9200", $host->getHost());
348+
$this->assertSame("foo.com", $host->getHost());
349349
$this->assertSame("https", $host->getTransportSchema());
350350

351351

@@ -356,7 +356,7 @@ public function testExtendedHosts()
356356
]
357357
])->build();
358358
$host = $client->transport->getConnection();
359-
$this->assertSame("foo.com:9200", $host->getHost());
359+
$this->assertSame("foo.com", $host->getHost());
360360
$this->assertSame("http", $host->getTransportSchema());
361361

362362

@@ -366,7 +366,7 @@ public function testExtendedHosts()
366366
]
367367
])->build();
368368
$host = $client->transport->getConnection();
369-
$this->assertSame("foo.com:9200", $host->getHost());
369+
$this->assertSame("foo.com", $host->getHost());
370370
$this->assertSame("http", $host->getTransportSchema());
371371

372372

@@ -378,7 +378,7 @@ public function testExtendedHosts()
378378
]
379379
])->build();
380380
$host = $client->transport->getConnection();
381-
$this->assertSame("foo.com:9500", $host->getHost());
381+
$this->assertSame("foo.com", $host->getHost());
382382
$this->assertSame("https", $host->getTransportSchema());
383383

384384

@@ -401,7 +401,7 @@ public function testExtendedHosts()
401401
]
402402
])->build();
403403
$host = $client->transport->getConnection();
404-
$this->assertSame("the_foo.com:9200", $host->getHost());
404+
$this->assertSame("the_foo.com", $host->getHost());
405405
$this->assertSame("http", $host->getTransportSchema());
406406

407407

@@ -414,7 +414,7 @@ public function testExtendedHosts()
414414
]
415415
])->build();
416416
$host = $client->transport->getConnection();
417-
$this->assertSame("foo.com:9200", $host->getHost());
417+
$this->assertSame("foo.com", $host->getHost());
418418
$this->assertSame("http", $host->getTransportSchema());
419419
$this->assertSame("user:abc#$@?%!abc", $host->getUserPass());
420420
}

0 commit comments

Comments
 (0)