Skip to content

Commit

Permalink
Port should always be an integer
Browse files Browse the repository at this point in the history
  • Loading branch information
stovak committed Feb 4, 2025
1 parent ce655ae commit 0889f3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Plugin/SolrConnector/PantheonSolrConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static function getPlatformConfig() {
return [
'scheme' => getenv('PANTHEON_INDEX_SCHEME'),
'host' => getenv('PANTHEON_INDEX_HOST'),
'port' => getenv('PANTHEON_INDEX_PORT'),
'port' => intval(getenv('PANTHEON_INDEX_PORT')),
'path' => getenv('PANTHEON_INDEX_PATH'),
'core' => getenv('PANTHEON_INDEX_CORE'),
'schema' => getenv('PANTHEON_INDEX_SCHEMA'),
Expand Down
5 changes: 3 additions & 2 deletions tests/Unit/EndpointServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function testURIGeneration() {
$ep = new Endpoint([
'scheme' => 'one',
'host' => 'two',
'port' => '1234',
'port' => 1234,
'path' => 'server-path',
'core' => '/core-name',
'schema' => '/schema-path',
Expand All @@ -34,7 +34,8 @@ public function testURIGeneration() {
$this->assertEquals('/core-name', $ep->getCore());
$this->assertEquals('server-path', $ep->getPath());
$this->assertEquals('one', $ep->getScheme());
$this->assertEquals('1234', $ep->getPort());
// If port is a string in the test, it should be an integer.
$this->assertEquals(1234, $ep->getPort());
$this->assertEquals('one://two:1234/', $ep->getBaseUri());
$this->assertEquals(
'one://two:1234/server-path/core-name/',
Expand Down

0 comments on commit 0889f3c

Please sign in to comment.