Add a port test

[MAILPOET-3580]
This commit is contained in:
Pavel Dohnal
2021-05-20 12:44:57 +02:00
committed by Veljko V
parent ea1a946a7b
commit 86e89f7fc1

View File

@@ -43,6 +43,18 @@ class ConnectionFactoryTest extends \MailPoetTest {
expect(Type::getType(JsonOrSerializedType::NAME))->isInstanceOf(JsonOrSerializedType::class);
}
public function testItSetsUpPort() {
$backup = Env::$dbPort;
try {
Env::$dbPort = 3456;
$connectionFactory = new ConnectionFactory();
$connection = $connectionFactory->createConnection();
expect($connection->getPort())->equals(3456);
} finally {
Env::$dbPort = $backup;
}
}
public function testItIgnoresEmptyCharset() {
Env::$dbCharset = '';
$connectionFactory = new ConnectionFactory();