Try to fix flaky SubscribersTest

[MAILPOET-1582]
This commit is contained in:
Jan Jakeš
2018-12-04 16:35:09 +01:00
committed by Pavel Dohnal
parent 3831f127c1
commit 1370c0939b

View File

@@ -21,6 +21,8 @@ use MailPoet\Subscribers\Source;
class SubscribersTest extends \MailPoetTest {
function _before() {
$this->cleanup();
$obfuscator = new FieldNameObfuscator();
$this->obfuscatedEmail = $obfuscator->obfuscate('email');
$this->obfuscatedSegments = $obfuscator->obfuscate('segments');
@@ -650,6 +652,10 @@ class SubscribersTest extends \MailPoetTest {
}
function _after() {
$this->cleanup();
}
private function cleanup() {
\ORM::raw_execute('TRUNCATE ' . Newsletter::$_table);
\ORM::raw_execute('TRUNCATE ' . NewsletterOption::$_table);
\ORM::raw_execute('TRUNCATE ' . NewsletterOptionField::$_table);