From bd3d6467bdce3a64f6a58b1b563bcc20a9adfe0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=CC=81n=20Mikla=CC=81s=CC=8C?= Date: Thu, 21 Mar 2019 14:43:13 +0100 Subject: [PATCH] More robust setting sending method in UnauthorizedAddressCest [MAILPOET-1882] --- tests/acceptance/UnauthorizedAddressCest.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/UnauthorizedAddressCest.php b/tests/acceptance/UnauthorizedAddressCest.php index f37465c754..2e0412a2bc 100644 --- a/tests/acceptance/UnauthorizedAddressCest.php +++ b/tests/acceptance/UnauthorizedAddressCest.php @@ -10,11 +10,13 @@ require_once __DIR__ . '/../DataFactories/Newsletter.php'; require_once __DIR__ . '/../DataFactories/Settings.php'; class UnauthorizedAddressCest { - function unauthorizedFreeAddressError(\AcceptanceTester $I) { - $I->wantTo('See proper sending error when using unauthorized free address'); - + function _before() { $settings = new Settings(); $settings->withSendingMethodMailPoet(); + } + + function unauthorizedFreeAddressError(\AcceptanceTester $I) { + $I->wantTo('See proper sending error when using unauthorized free address'); $newsletter_title = 'Unauthorized free address'; $newsletter_from = 'random@gmail.com'; @@ -85,11 +87,14 @@ class UnauthorizedAddressCest { $href = $I->grabAttributeFrom('//a[text()="Authorize your email in your account now."]', 'href'); expect($href)->equals('https://account.mailpoet.com/authorization'); - // step 5 - Trash newsletter, resume sending and set sending method back to SMTP + // step 5 - Trash newsletter and resume sending $I->clickItemRowActionByItemName($newsletter_title, 'Move to trash'); $I->click('Resume sending'); $I->waitForText('Sending has been resumed.'); + } + + function _after() { $settings = new Settings(); - $settings->withSendingMethod(Mailer::METHOD_SMTP); + $settings->withSendingMethod(Mailer::METHOD_PHPMAIL); } }