From 5b465c7f311108878f7352f25a4e40f6c5ee0d7e Mon Sep 17 00:00:00 2001 From: Andrew Dyer Date: Fri, 19 Feb 2021 11:42:05 +0000 Subject: [PATCH 1/2] :wrench: Get transport credentials from env --- phpunit.xml | 1 + tests/MailerTest.php | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 75e6f98..07b0d8e 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -16,6 +16,7 @@ + diff --git a/tests/MailerTest.php b/tests/MailerTest.php index 42d3519..adff525 100644 --- a/tests/MailerTest.php +++ b/tests/MailerTest.php @@ -11,11 +11,11 @@ final class MailerTest extends TestCase { public function testCanConfigureTransport(): void { - $host = 'localhost'; - $port = 25; - $protocol = 'tls'; - $username = 'username'; - $password = 'password'; + $host = getenv('MAILER_HOST'); + $port = getenv('MAILER_PORT'); + $protocol = getenv('MAILER_ENCRYPTION'); + $username = getenv('MAILER_USERNAME'); + $password = getenv('MAILER_PASSWORD'); $mailer = new Mailer(new Twig(__DIR__), compact('host', 'port', 'username', 'password', 'protocol')); @@ -38,6 +38,7 @@ public function testCanSendMessage(): void 'port' => getenv('MAILER_PORT'), 'username' => getenv('MAILER_USERNAME'), 'password' => getenv('MAILER_PASSWORD'), + 'protocol' => getenv('MAILER_ENCRYPTION'), ]); $mailer->setDefaultFrom($address, $name); From 6304dfd17b4c9a7fd2d4219db1fb26b5bbfae8a8 Mon Sep 17 00:00:00 2001 From: Andrew Dyer Date: Fri, 19 Feb 2021 11:43:08 +0000 Subject: [PATCH 2/2] :wrench: Updated testsuite name --- phpunit.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml b/phpunit.xml index 07b0d8e..fd4024d 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -9,7 +9,7 @@ processIsolation="false" stopOnFailure="false"> - + ./tests