Skip to content

Commit 54369b6

Browse files
authored
Port assertions should be integers not strings
1 parent b4eca5c commit 54369b6

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
@@ -277,7 +277,7 @@ public function testInlineHosts()
277277
])->build();
278278
$host = $client->transport->getConnection();
279279
$this->assertSame("localhost", $host->getHost());
280-
$this->assertSame("9200", $host->getPort());
280+
$this->assertSame(9200, $host->getPort());
281281
$this->assertSame("http", $host->getTransportSchema());
282282

283283

@@ -286,23 +286,23 @@ public function testInlineHosts()
286286
])->build();
287287
$host = $client->transport->getConnection();
288288
$this->assertSame("localhost", $host->getHost());
289-
$this->assertSame("9200", $host->getPort());
289+
$this->assertSame(9200, $host->getPort());
290290
$this->assertSame("http", $host->getTransportSchema());
291291

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

300300
$client = Elasticsearch\ClientBuilder::create()->setHosts([
301301
'https://foo.com:9200'
302302
])->build();
303303
$host = $client->transport->getConnection();
304304
$this->assertSame("foo.com", $host->getHost());
305-
$this->assertSame("9200", $host->getPort());
305+
$this->assertSame(9200, $host->getPort());
306306
$this->assertSame("https", $host->getTransportSchema());
307307

308308

@@ -311,7 +311,7 @@ public function testInlineHosts()
311311
])->build();
312312
$host = $client->transport->getConnection();
313313
$this->assertSame("foo.com", $host->getHost());
314-
$this->assertSame("9200", $host->getPort());
314+
$this->assertSame(9200, $host->getPort());
315315
$this->assertSame("https", $host->getTransportSchema());
316316
$this->assertSame("user:pass", $host->getUserPass());
317317
}
@@ -327,7 +327,7 @@ public function testExtendedHosts()
327327
])->build();
328328
$host = $client->transport->getConnection();
329329
$this->assertSame("localhost", $host->getHost());
330-
$this->assertSame("9200", $host->getPort());
330+
$this->assertSame(9200, $host->getPort());
331331
$this->assertSame("http", $host->getTransportSchema());
332332

333333

@@ -340,7 +340,7 @@ public function testExtendedHosts()
340340
])->build();
341341
$host = $client->transport->getConnection();
342342
$this->assertSame("foo.com", $host->getHost());
343-
$this->assertSame("9200", $host->getPort());
343+
$this->assertSame(9200, $host->getPort());
344344
$this->assertSame("http", $host->getTransportSchema());
345345

346346

@@ -353,7 +353,7 @@ public function testExtendedHosts()
353353
])->build();
354354
$host = $client->transport->getConnection();
355355
$this->assertSame("foo.com", $host->getHost());
356-
$this->assertSame("9200", $host->getPort());
356+
$this->assertSame(9200, $host->getPort());
357357
$this->assertSame("https", $host->getTransportSchema());
358358

359359

@@ -365,7 +365,7 @@ public function testExtendedHosts()
365365
])->build();
366366
$host = $client->transport->getConnection();
367367
$this->assertSame("foo.com", $host->getHost());
368-
$this->assertSame("9200", $host->getPort());
368+
$this->assertSame(9200, $host->getPort());
369369
$this->assertSame("http", $host->getTransportSchema());
370370

371371

@@ -376,7 +376,7 @@ public function testExtendedHosts()
376376
])->build();
377377
$host = $client->transport->getConnection();
378378
$this->assertSame("foo.com", $host->getHost());
379-
$this->assertSame("9200", $host->getPort());
379+
$this->assertSame(9200, $host->getPort());
380380
$this->assertSame("http", $host->getTransportSchema());
381381

382382

@@ -389,7 +389,7 @@ public function testExtendedHosts()
389389
])->build();
390390
$host = $client->transport->getConnection();
391391
$this->assertSame("foo.com", $host->getHost());
392-
$this->assertSame("9500", $host->getPort());
392+
$this->assertSame(9500, $host->getPort());
393393
$this->assertSame("https", $host->getTransportSchema());
394394

395395

@@ -413,7 +413,7 @@ public function testExtendedHosts()
413413
])->build();
414414
$host = $client->transport->getConnection();
415415
$this->assertSame("the_foo.com", $host->getHost());
416-
$this->assertSame("9200", $host->getPort());
416+
$this->assertSame(9200, $host->getPort());
417417
$this->assertSame("http", $host->getTransportSchema());
418418

419419

@@ -427,7 +427,7 @@ public function testExtendedHosts()
427427
])->build();
428428
$host = $client->transport->getConnection();
429429
$this->assertSame("foo.com", $host->getHost());
430-
$this->assertSame("9200", $host->getPort());
430+
$this->assertSame(9200, $host->getPort());
431431
$this->assertSame("http", $host->getTransportSchema());
432432
$this->assertSame("user:abc#$@?%!abc", $host->getUserPass());
433433
}

0 commit comments

Comments
 (0)