From 86e89f7fc129174fcd3f3a01a784b00b0d156a92 Mon Sep 17 00:00:00 2001 From: Pavel Dohnal Date: Thu, 20 May 2021 12:44:57 +0200 Subject: [PATCH] Add a port test [MAILPOET-3580] --- tests/integration/Doctrine/ConnectionFactoryTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/integration/Doctrine/ConnectionFactoryTest.php b/tests/integration/Doctrine/ConnectionFactoryTest.php index c45863fe92..6a8b21b0f2 100644 --- a/tests/integration/Doctrine/ConnectionFactoryTest.php +++ b/tests/integration/Doctrine/ConnectionFactoryTest.php @@ -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();