Fix DSN test

This commit is contained in:
Eldad Fux 2022-10-17 19:43:26 +03:00
parent bef62ddc71
commit 892f74c2a8
2 changed files with 6 additions and 6 deletions

View file

@ -27,7 +27,7 @@ class DSN
/**
* @var ?int
*/
protected ?int $port;
protected ?string $port;
/**
* @var ?string
@ -106,11 +106,11 @@ class DSN
/**
* Return the port
*
* @return ?int
* @return ?string
*/
public function getPort(): ?int
public function getPort(): ?string
{
return (int)$this->port;
return $this->port;
}
/**

View file

@ -14,7 +14,7 @@ class DSNTest extends TestCase
$this->assertEquals("user", $dsn->getUser());
$this->assertEquals("password", $dsn->getPassword());
$this->assertEquals("localhost", $dsn->getHost());
$this->assertEquals(3306, $dsn->getPort());
$this->assertEquals("3306", $dsn->getPort());
$this->assertEquals("database", $dsn->getDatabase());
$this->assertEquals("charset=utf8&timezone=UTC", $dsn->getQuery());
@ -23,7 +23,7 @@ class DSNTest extends TestCase
$this->assertEquals("user", $dsn->getUser());
$this->assertNull($dsn->getPassword());
$this->assertEquals("localhost", $dsn->getHost());
$this->assertEquals(3306, $dsn->getPort());
$this->assertEquals("3306", $dsn->getPort());
$this->assertEquals("database", $dsn->getDatabase());
$this->assertEquals("charset=utf8&timezone=UTC", $dsn->getQuery());