Disable email notifications by default in tests

[MAILPOET-2209]
This commit is contained in:
Jan Jakeš
2019-08-21 15:52:41 +02:00
committed by M. Shull
parent 1057f43d1c
commit e3708ebffb

View File

@ -21,6 +21,7 @@ class Settings {
$this->withSender('admin', 'wp@example.com');
$this->withSkippedTutorials();
$this->withCookieRevenueTracking();
$this->withEmailNotificationsDisabled();
}
function withCronTriggerMethod($method) {
@ -33,6 +34,12 @@ class Settings {
$this->settings->set('sender.address', $address);
}
function withEmailNotificationsDisabled() {
$this->settings->set('stats_notifications.enabled', 0);
$this->settings->set('subscriber_email_notification.enabled', 0);
return $this;
}
function withConfirmationEmailSubject($subject = null) {
if ($subject === null) {
$subject = sprintf('Confirm your subscription to %1$s', get_option('blogname'));