Fix mock naming and strings in integration tests
[MAILPOET-1796]
This commit is contained in:
@ -22,7 +22,7 @@ class SerializableConnection extends Connection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function __sleep() {
|
public function __sleep() {
|
||||||
return ['params', 'driver', 'config', 'event_manager'];
|
return ['params', 'driver', 'config', 'eventManager'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __wakeup() {
|
public function __wakeup() {
|
||||||
|
@ -130,8 +130,8 @@ class FeatureFlagsTest extends \MailPoetTest {
|
|||||||
'defaults' => $defaults,
|
'defaults' => $defaults,
|
||||||
]);
|
]);
|
||||||
$featureFlags = Stub::make(FeatureFlagsController::class, [
|
$featureFlags = Stub::make(FeatureFlagsController::class, [
|
||||||
'features_controller' => $featuresController,
|
'featuresController' => $featuresController,
|
||||||
'feature_flags_repository' => $this->diContainer->get(FeatureFlagsRepository::class),
|
'featureFlagsRepository' => $this->diContainer->get(FeatureFlagsRepository::class),
|
||||||
]);
|
]);
|
||||||
return new FeatureFlags($featuresController, $featureFlags);
|
return new FeatureFlags($featuresController, $featureFlags);
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class UserFlagsTest extends \MailPoetTest {
|
|||||||
public function _before() {
|
public function _before() {
|
||||||
$this->cleanup();
|
$this->cleanup();
|
||||||
$this->userFlags = Stub::make(UserFlagsController::class, [
|
$this->userFlags = Stub::make(UserFlagsController::class, [
|
||||||
'user_flags_repository' => $this->diContainer->get(UserFlagsRepository::class),
|
'userFlagsRepository' => $this->diContainer->get(UserFlagsRepository::class),
|
||||||
'defaults' => [
|
'defaults' => [
|
||||||
'flag_1' => 'default_value_1',
|
'flag_1' => 'default_value_1',
|
||||||
'flag_2' => 'default_value_2',
|
'flag_2' => 'default_value_2',
|
||||||
|
@ -530,8 +530,8 @@ class APITest extends \MailPoetTest {
|
|||||||
\MailPoet\API\MP\v1\API::class,
|
\MailPoet\API\MP\v1\API::class,
|
||||||
'addSubscriber',
|
'addSubscriber',
|
||||||
[
|
[
|
||||||
'new_subscriber_notification_mailer' => Stub::makeEmpty(NewSubscriberNotificationMailer::class, ['send']),
|
'newSubscriberNotificationMailer' => Stub::makeEmpty(NewSubscriberNotificationMailer::class, ['send']),
|
||||||
'required_custom_field_validator' => Stub::makeEmpty(RequiredCustomFieldValidator::class, ['validate']),
|
'requiredCustomFieldValidator' => Stub::makeEmpty(RequiredCustomFieldValidator::class, ['validate']),
|
||||||
'_scheduleWelcomeNotification' => Expected::once(),
|
'_scheduleWelcomeNotification' => Expected::once(),
|
||||||
], $this);
|
], $this);
|
||||||
$subscriber = [
|
$subscriber = [
|
||||||
@ -578,10 +578,10 @@ class APITest extends \MailPoetTest {
|
|||||||
'addSubscriber',
|
'addSubscriber',
|
||||||
[
|
[
|
||||||
'_scheduleWelcomeNotification' => Expected::never(),
|
'_scheduleWelcomeNotification' => Expected::never(),
|
||||||
'new_subscriber_notification_mailer' => Stub::makeEmpty(
|
'newSubscriberNotificationMailer' => Stub::makeEmpty(
|
||||||
NewSubscriberNotificationMailer::class, ['send' => Expected::never()]
|
NewSubscriberNotificationMailer::class, ['send' => Expected::never()]
|
||||||
),
|
),
|
||||||
'required_custom_field_validator' => Stub::makeEmpty(RequiredCustomFieldValidator::class, ['validate']),
|
'requiredCustomFieldValidator' => Stub::makeEmpty(RequiredCustomFieldValidator::class, ['validate']),
|
||||||
], $this);
|
], $this);
|
||||||
$subscriber = [
|
$subscriber = [
|
||||||
'email' => 'test@example.com',
|
'email' => 'test@example.com',
|
||||||
@ -596,8 +596,8 @@ class APITest extends \MailPoetTest {
|
|||||||
'addSubscriber',
|
'addSubscriber',
|
||||||
[
|
[
|
||||||
'_scheduleWelcomeNotification' => Expected::never(),
|
'_scheduleWelcomeNotification' => Expected::never(),
|
||||||
'new_subscriber_notification_mailer' => Stub::makeEmpty(NewSubscriberNotificationMailer::class, ['send']),
|
'newSubscriberNotificationMailer' => Stub::makeEmpty(NewSubscriberNotificationMailer::class, ['send']),
|
||||||
'required_custom_field_validator' => Stub::makeEmpty(RequiredCustomFieldValidator::class, ['validate']),
|
'requiredCustomFieldValidator' => Stub::makeEmpty(RequiredCustomFieldValidator::class, ['validate']),
|
||||||
], $this);
|
], $this);
|
||||||
$subscriber = [
|
$subscriber = [
|
||||||
'email' => 'test@example.com',
|
'email' => 'test@example.com',
|
||||||
@ -617,8 +617,8 @@ class APITest extends \MailPoetTest {
|
|||||||
expect($options)->contains('send_confirmation_email');
|
expect($options)->contains('send_confirmation_email');
|
||||||
expect($options['send_confirmation_email'])->equals(true);
|
expect($options['send_confirmation_email'])->equals(true);
|
||||||
}),
|
}),
|
||||||
'required_custom_field_validator' => Stub::makeEmpty(RequiredCustomFieldValidator::class, ['validate']),
|
'requiredCustomFieldValidator' => Stub::makeEmpty(RequiredCustomFieldValidator::class, ['validate']),
|
||||||
'new_subscriber_notification_mailer' => Stub::makeEmpty(NewSubscriberNotificationMailer::class, ['send']),
|
'newSubscriberNotificationMailer' => Stub::makeEmpty(NewSubscriberNotificationMailer::class, ['send']),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$subscriber = [
|
$subscriber = [
|
||||||
@ -638,7 +638,7 @@ class APITest extends \MailPoetTest {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$API = Stub::copy($this->getApi(), [
|
$API = Stub::copy($this->getApi(), [
|
||||||
'confirmation_email_mailer' => $confirmationMailer,
|
'confirmationEmailMailer' => $confirmationMailer,
|
||||||
]);
|
]);
|
||||||
$segment = Segment::createOrUpdate(
|
$segment = Segment::createOrUpdate(
|
||||||
[
|
[
|
||||||
@ -659,8 +659,8 @@ class APITest extends \MailPoetTest {
|
|||||||
'addSubscriber',
|
'addSubscriber',
|
||||||
[
|
[
|
||||||
'__sendConfirmationEmail' => Expected::never(),
|
'__sendConfirmationEmail' => Expected::never(),
|
||||||
'required_custom_field_validator' => Stub::makeEmpty(RequiredCustomFieldValidator::class, ['validate']),
|
'requiredCustomFieldValidator' => Stub::makeEmpty(RequiredCustomFieldValidator::class, ['validate']),
|
||||||
'new_subscriber_notification_mailer' => Stub::makeEmpty(NewSubscriberNotificationMailer::class, ['send']),
|
'newSubscriberNotificationMailer' => Stub::makeEmpty(NewSubscriberNotificationMailer::class, ['send']),
|
||||||
], $this);
|
], $this);
|
||||||
$subscriber = [
|
$subscriber = [
|
||||||
'email' => 'test@example.com',
|
'email' => 'test@example.com',
|
||||||
|
@ -248,9 +248,9 @@ class AbandonedCartTest extends \MailPoetTest {
|
|||||||
private function createAbandonedCartEmail() {
|
private function createAbandonedCartEmail() {
|
||||||
return $this->make(AbandonedCart::class, [
|
return $this->make(AbandonedCart::class, [
|
||||||
'wp' => $this->wp,
|
'wp' => $this->wp,
|
||||||
'woo_commerce_helper' => $this->wooCommerceHelperMock,
|
'wooCommerceHelper' => $this->wooCommerceHelperMock,
|
||||||
'cookies' => new Cookies(),
|
'cookies' => new Cookies(),
|
||||||
'page_visit_tracker' => $this->pageVisitTrackerMock,
|
'pageVisitTracker' => $this->pageVisitTrackerMock,
|
||||||
'scheduler' => new AutomaticEmailScheduler(),
|
'scheduler' => new AutomaticEmailScheduler(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ class CapabilitiesTest extends \MailPoetTest {
|
|||||||
'registerMembersCapabilities',
|
'registerMembersCapabilities',
|
||||||
[
|
[
|
||||||
'registerMembersCapability' => Expected::exactly($permissionCount),
|
'registerMembersCapability' => Expected::exactly($permissionCount),
|
||||||
'access_control' => $this->accessControl,
|
'accessControl' => $this->accessControl,
|
||||||
],
|
],
|
||||||
$this
|
$this
|
||||||
);
|
);
|
||||||
|
@ -32,8 +32,8 @@ class DatabaseTest extends \MailPoetTest {
|
|||||||
$result = ORM::for_table("")
|
$result = ORM::for_table("")
|
||||||
->raw_query(
|
->raw_query(
|
||||||
'SELECT ' .
|
'SELECT ' .
|
||||||
'@@sql_mode as sql_mode, ' .
|
'@@sql_mode as sqlMode, ' .
|
||||||
'@@session.time_zone as time_zone'
|
'@@session.time_zone as timeZone'
|
||||||
)
|
)
|
||||||
->findOne();
|
->findOne();
|
||||||
// disable ONLY_FULL_GROUP_BY
|
// disable ONLY_FULL_GROUP_BY
|
||||||
|
@ -434,8 +434,8 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
'deleteQueueOrUpdateNextRunDate' => Expected::exactly(1, function() {
|
'deleteQueueOrUpdateNextRunDate' => Expected::exactly(1, function() {
|
||||||
return false;
|
return false;
|
||||||
}),
|
}),
|
||||||
'logger_factory' => $this->loggerFactory,
|
'loggerFactory' => $this->loggerFactory,
|
||||||
'cron_helper' => $this->cronHelper,
|
'cronHelper' => $this->cronHelper,
|
||||||
], $this);
|
], $this);
|
||||||
expect($scheduler->processPostNotificationNewsletter($newsletter, $queue))->false();
|
expect($scheduler->processPostNotificationNewsletter($newsletter, $queue))->false();
|
||||||
}
|
}
|
||||||
@ -525,7 +525,7 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
$queue->save();
|
$queue->save();
|
||||||
$scheduler = Stub::make(Scheduler::class, [
|
$scheduler = Stub::make(Scheduler::class, [
|
||||||
'processWelcomeNewsletter' => Expected::exactly(1),
|
'processWelcomeNewsletter' => Expected::exactly(1),
|
||||||
'cron_helper' => $this->cronHelper,
|
'cronHelper' => $this->cronHelper,
|
||||||
], $this);
|
], $this);
|
||||||
$scheduler->process();
|
$scheduler->process();
|
||||||
}
|
}
|
||||||
@ -537,7 +537,7 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
$queue->save();
|
$queue->save();
|
||||||
$scheduler = Stub::make(Scheduler::class, [
|
$scheduler = Stub::make(Scheduler::class, [
|
||||||
'processPostNotificationNewsletter' => Expected::exactly(1),
|
'processPostNotificationNewsletter' => Expected::exactly(1),
|
||||||
'cron_helper' => $this->cronHelper,
|
'cronHelper' => $this->cronHelper,
|
||||||
], $this);
|
], $this);
|
||||||
$scheduler->process();
|
$scheduler->process();
|
||||||
}
|
}
|
||||||
@ -549,7 +549,7 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
$queue->save();
|
$queue->save();
|
||||||
$scheduler = Stub::make(Scheduler::class, [
|
$scheduler = Stub::make(Scheduler::class, [
|
||||||
'processScheduledStandardNewsletter' => Expected::exactly(1),
|
'processScheduledStandardNewsletter' => Expected::exactly(1),
|
||||||
'cron_helper' => $this->cronHelper,
|
'cronHelper' => $this->cronHelper,
|
||||||
], $this);
|
], $this);
|
||||||
$scheduler->process();
|
$scheduler->process();
|
||||||
}
|
}
|
||||||
@ -561,7 +561,7 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
$queue->save();
|
$queue->save();
|
||||||
$scheduler = Stub::make(Scheduler::class, [
|
$scheduler = Stub::make(Scheduler::class, [
|
||||||
'processPostNotificationNewsletter' => Expected::exactly(1),
|
'processPostNotificationNewsletter' => Expected::exactly(1),
|
||||||
'cron_helper' => $this->make(CronHelper::class, [
|
'cronHelper' => $this->make(CronHelper::class, [
|
||||||
'enforceExecutionLimit' => Expected::exactly(2), // call at start + during processing
|
'enforceExecutionLimit' => Expected::exactly(2), // call at start + during processing
|
||||||
]),
|
]),
|
||||||
], $this);
|
], $this);
|
||||||
@ -576,7 +576,7 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
|
|
||||||
$scheduler = Stub::make(Scheduler::class, [
|
$scheduler = Stub::make(Scheduler::class, [
|
||||||
'processScheduledStandardNewsletter' => Expected::never(),
|
'processScheduledStandardNewsletter' => Expected::never(),
|
||||||
'cron_helper' => $this->cronHelper,
|
'cronHelper' => $this->cronHelper,
|
||||||
], $this);
|
], $this);
|
||||||
// scheduled job is not processed
|
// scheduled job is not processed
|
||||||
$scheduler->process();
|
$scheduler->process();
|
||||||
@ -590,7 +590,7 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
|
|
||||||
$scheduler = Stub::make(Scheduler::class, [
|
$scheduler = Stub::make(Scheduler::class, [
|
||||||
'processScheduledStandardNewsletter' => Expected::once(),
|
'processScheduledStandardNewsletter' => Expected::once(),
|
||||||
'cron_helper' => $this->cronHelper,
|
'cronHelper' => $this->cronHelper,
|
||||||
], $this);
|
], $this);
|
||||||
// scheduled job is processed
|
// scheduled job is processed
|
||||||
$scheduler->process();
|
$scheduler->process();
|
||||||
@ -636,7 +636,7 @@ class SchedulerTest extends \MailPoetTest {
|
|||||||
|
|
||||||
$scheduler = Stub::make(Scheduler::class, [
|
$scheduler = Stub::make(Scheduler::class, [
|
||||||
'processScheduledStandardNewsletter' => Expected::once(),
|
'processScheduledStandardNewsletter' => Expected::once(),
|
||||||
'cron_helper' => $this->cronHelper,
|
'cronHelper' => $this->cronHelper,
|
||||||
], $this);
|
], $this);
|
||||||
// scheduled job is processed
|
// scheduled job is processed
|
||||||
$scheduler->process();
|
$scheduler->process();
|
||||||
|
@ -247,7 +247,7 @@ class SendingQueueTest extends \MailPoetTest {
|
|||||||
[
|
[
|
||||||
'processQueue' => function() {
|
'processQueue' => function() {
|
||||||
// this function returns a queue object
|
// this function returns a queue object
|
||||||
return (object)['status' => null, 'task_id' => 0];
|
return (object)['status' => null, 'taskId' => 0];
|
||||||
},
|
},
|
||||||
'enforceSendingAndExecutionLimits' => Expected::exactly(2),
|
'enforceSendingAndExecutionLimits' => Expected::exactly(2),
|
||||||
], $this);
|
], $this);
|
||||||
|
@ -120,14 +120,14 @@ class MailerTest extends \MailPoetTest {
|
|||||||
// mock mailer instance and ensure that send method is invoked
|
// mock mailer instance and ensure that send method is invoked
|
||||||
$mailerTask = new MailerTask(
|
$mailerTask = new MailerTask(
|
||||||
(object)[
|
(object)[
|
||||||
'mailer_instance' => Stub::make(
|
'mailerInstance' => Stub::make(
|
||||||
$phpMailClass,
|
$phpMailClass,
|
||||||
['send' => Expected::exactly(1, function() {
|
['send' => Expected::exactly(1, function() {
|
||||||
return true;
|
return true;
|
||||||
})],
|
})],
|
||||||
$this
|
$this
|
||||||
),
|
),
|
||||||
'mailer_config' => [
|
'mailerConfig' => [
|
||||||
'method' => null,
|
'method' => null,
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
|
@ -220,7 +220,7 @@ class NewsletterTest extends \MailPoetTest {
|
|||||||
$this->newsletter->parentId = $this->newsletter->id;
|
$this->newsletter->parentId = $this->newsletter->id;
|
||||||
$postsTask = $this->make(PostsTask::class, [
|
$postsTask = $this->make(PostsTask::class, [
|
||||||
'getAlcPostsCount' => 1,
|
'getAlcPostsCount' => 1,
|
||||||
'logger_factory' => $this->loggerFactory,
|
'loggerFactory' => $this->loggerFactory,
|
||||||
]);
|
]);
|
||||||
$newsletterTask = new NewsletterTask(new WPFunctions, $postsTask);
|
$newsletterTask = new NewsletterTask(new WPFunctions, $postsTask);
|
||||||
$result = $newsletterTask->preProcessNewsletter($this->newsletter, $this->queue);
|
$result = $newsletterTask->preProcessNewsletter($this->newsletter, $this->queue);
|
||||||
|
@ -32,7 +32,7 @@ class PostsTest extends \MailPoetTest {
|
|||||||
$postId = 10;
|
$postId = 10;
|
||||||
$newsletter = (object)[
|
$newsletter = (object)[
|
||||||
'id' => 2,
|
'id' => 2,
|
||||||
'parent_id' => 1,
|
'parentId' => 1,
|
||||||
'type' => Newsletter::TYPE_NOTIFICATION_HISTORY,
|
'type' => Newsletter::TYPE_NOTIFICATION_HISTORY,
|
||||||
];
|
];
|
||||||
$renderedNewsletter = [
|
$renderedNewsletter = [
|
||||||
|
@ -114,7 +114,7 @@ class ConnectionFactoryTest extends \MailPoetTest {
|
|||||||
public function testItSelectivelyUpdatesWaitTimeoutOption() {
|
public function testItSelectivelyUpdatesWaitTimeoutOption() {
|
||||||
// timeout will be kept from DB defaults
|
// timeout will be kept from DB defaults
|
||||||
$connectionFactory = $this->make(ConnectionFactory::class, [
|
$connectionFactory = $this->make(ConnectionFactory::class, [
|
||||||
'min_wait_timeout' => 1,
|
'minWaitTimeout' => 1,
|
||||||
]);
|
]);
|
||||||
$connection = $connectionFactory->createConnection();
|
$connection = $connectionFactory->createConnection();
|
||||||
$current = $connection->executeQuery('SELECT @@session.wait_timeout')->fetchColumn();
|
$current = $connection->executeQuery('SELECT @@session.wait_timeout')->fetchColumn();
|
||||||
@ -122,7 +122,7 @@ class ConnectionFactoryTest extends \MailPoetTest {
|
|||||||
|
|
||||||
// timeout will be set to higher value
|
// timeout will be set to higher value
|
||||||
$connectionFactory = $this->make(ConnectionFactory::class, [
|
$connectionFactory = $this->make(ConnectionFactory::class, [
|
||||||
'min_wait_timeout' => 999999,
|
'minWaitTimeout' => 999999,
|
||||||
]);
|
]);
|
||||||
$connection = $connectionFactory->createConnection();
|
$connection = $connectionFactory->createConnection();
|
||||||
$current = $connection->executeQuery('SELECT @@session.wait_timeout')->fetchColumn();
|
$current = $connection->executeQuery('SELECT @@session.wait_timeout')->fetchColumn();
|
||||||
|
@ -249,7 +249,7 @@ class AmazonSESTest extends \MailPoetTest {
|
|||||||
$blacklist = Stub::make(new BlacklistCheck(), ['isBlacklisted' => true], $this);
|
$blacklist = Stub::make(new BlacklistCheck(), ['isBlacklisted' => true], $this);
|
||||||
$mailer = Stub::make(
|
$mailer = Stub::make(
|
||||||
$this->mailer,
|
$this->mailer,
|
||||||
['blacklist' => $blacklist, 'error_mapper' => new AmazonSESMapper()],
|
['blacklist' => $blacklist, 'errorMapper' => new AmazonSESMapper()],
|
||||||
$this
|
$this
|
||||||
);
|
);
|
||||||
$result = $mailer->send(
|
$result = $mailer->send(
|
||||||
|
@ -276,8 +276,8 @@ class MailPoetAPITest extends \MailPoetTest {
|
|||||||
$this->mailer,
|
$this->mailer,
|
||||||
[
|
[
|
||||||
'blacklist' => $blacklist,
|
'blacklist' => $blacklist,
|
||||||
'error_mapper' => new MailPoetMapper(),
|
'errorMapper' => new MailPoetMapper(),
|
||||||
'services_checker' => Stub::make(
|
'servicesChecker' => Stub::make(
|
||||||
new ServicesChecker(),
|
new ServicesChecker(),
|
||||||
['isMailPoetAPIKeyValid' => true],
|
['isMailPoetAPIKeyValid' => true],
|
||||||
$this
|
$this
|
||||||
@ -302,8 +302,8 @@ class MailPoetAPITest extends \MailPoetTest {
|
|||||||
$this->mailer,
|
$this->mailer,
|
||||||
[
|
[
|
||||||
'blacklist' => $blacklist,
|
'blacklist' => $blacklist,
|
||||||
'error_mapper' => new MailPoetMapper(),
|
'errorMapper' => new MailPoetMapper(),
|
||||||
'services_checker' => Stub::make(
|
'servicesChecker' => Stub::make(
|
||||||
new ServicesChecker(),
|
new ServicesChecker(),
|
||||||
['isMailPoetAPIKeyValid' => true],
|
['isMailPoetAPIKeyValid' => true],
|
||||||
$this
|
$this
|
||||||
|
@ -142,7 +142,7 @@ class PHPMailTest extends \MailPoetTest {
|
|||||||
$blacklist = Stub::make(new BlacklistCheck(), ['isBlacklisted' => true], $this);
|
$blacklist = Stub::make(new BlacklistCheck(), ['isBlacklisted' => true], $this);
|
||||||
$mailer = Stub::make(
|
$mailer = Stub::make(
|
||||||
$this->mailer,
|
$this->mailer,
|
||||||
['blacklist' => $blacklist, 'error_mapper' => new PHPMailMapper()],
|
['blacklist' => $blacklist, 'errorMapper' => new PHPMailMapper()],
|
||||||
$this
|
$this
|
||||||
);
|
);
|
||||||
$result = $mailer->send(
|
$result = $mailer->send(
|
||||||
|
@ -188,7 +188,7 @@ class SMTPTest extends \MailPoetTest {
|
|||||||
$blacklist = Stub::make(new BlacklistCheck(), ['isBlacklisted' => true], $this);
|
$blacklist = Stub::make(new BlacklistCheck(), ['isBlacklisted' => true], $this);
|
||||||
$mailer = Stub::make(
|
$mailer = Stub::make(
|
||||||
$this->mailer,
|
$this->mailer,
|
||||||
['blacklist' => $blacklist, 'error_mapper' => new SMTPMapper()],
|
['blacklist' => $blacklist, 'errorMapper' => new SMTPMapper()],
|
||||||
$this
|
$this
|
||||||
);
|
);
|
||||||
$result = $mailer->send(
|
$result = $mailer->send(
|
||||||
|
@ -98,7 +98,7 @@ class SendGridTest extends \MailPoetTest {
|
|||||||
$blacklist = Stub::make(new BlacklistCheck(), ['isBlacklisted' => true], $this);
|
$blacklist = Stub::make(new BlacklistCheck(), ['isBlacklisted' => true], $this);
|
||||||
$mailer = Stub::make(
|
$mailer = Stub::make(
|
||||||
$this->mailer,
|
$this->mailer,
|
||||||
['blacklist' => $blacklist, 'error_mapper' => new SendGridMapper()],
|
['blacklist' => $blacklist, 'errorMapper' => new SendGridMapper()],
|
||||||
$this
|
$this
|
||||||
);
|
);
|
||||||
$result = $mailer->send(
|
$result = $mailer->send(
|
||||||
|
@ -281,7 +281,7 @@ class NewsletterTest extends \MailPoetTest {
|
|||||||
|
|
||||||
public function testItCanHaveOptions() {
|
public function testItCanHaveOptions() {
|
||||||
$newsletterOptions = [
|
$newsletterOptions = [
|
||||||
'name' => 'Event',
|
'name' => 'event',
|
||||||
'newsletter_type' => Newsletter::TYPE_WELCOME,
|
'newsletter_type' => Newsletter::TYPE_WELCOME,
|
||||||
];
|
];
|
||||||
$optionField = NewsletterOptionField::create();
|
$optionField = NewsletterOptionField::create();
|
||||||
|
@ -90,7 +90,7 @@ class TrackTest extends \MailPoetTest {
|
|||||||
);
|
);
|
||||||
$data->subscriber->email = 'random@email.com';
|
$data->subscriber->email = 'random@email.com';
|
||||||
$track = Stub::make(Track::class, [
|
$track = Stub::make(Track::class, [
|
||||||
'link_tokens' => new LinkTokens,
|
'linkTokens' => new LinkTokens,
|
||||||
'terminate' => function($code) {
|
'terminate' => function($code) {
|
||||||
expect($code)->equals(403);
|
expect($code)->equals(403);
|
||||||
},
|
},
|
||||||
|
@ -70,7 +70,7 @@ class ViewInBrowserTest extends \MailPoetTest {
|
|||||||
|
|
||||||
public function testItAbortsWhenBrowserPreviewDataIsInvalid() {
|
public function testItAbortsWhenBrowserPreviewDataIsInvalid() {
|
||||||
$viewInBrowser = Stub::make($this->viewInBrowser, [
|
$viewInBrowser = Stub::make($this->viewInBrowser, [
|
||||||
'link_tokens' => new LinkTokens,
|
'linkTokens' => new LinkTokens,
|
||||||
'_abort' => Expected::exactly(3),
|
'_abort' => Expected::exactly(3),
|
||||||
], $this);
|
], $this);
|
||||||
// newsletter ID is invalid
|
// newsletter ID is invalid
|
||||||
@ -215,7 +215,7 @@ class ViewInBrowserTest extends \MailPoetTest {
|
|||||||
|
|
||||||
public function testItReturnsViewActionResult() {
|
public function testItReturnsViewActionResult() {
|
||||||
$viewInBrowser = Stub::make($this->viewInBrowser, [
|
$viewInBrowser = Stub::make($this->viewInBrowser, [
|
||||||
'link_tokens' => new LinkTokens,
|
'linkTokens' => new LinkTokens,
|
||||||
'_displayNewsletter' => Expected::exactly(1),
|
'_displayNewsletter' => Expected::exactly(1),
|
||||||
'settings' => SettingsController::getInstance(),
|
'settings' => SettingsController::getInstance(),
|
||||||
'emoji' => new Emoji(),
|
'emoji' => new Emoji(),
|
||||||
|
@ -53,7 +53,7 @@ class SettingsControllerTest extends \MailPoetTest {
|
|||||||
|
|
||||||
public function testItReturnsDefaultValueAsFallback() {
|
public function testItReturnsDefaultValueAsFallback() {
|
||||||
$settings = Stub::make($this->controller, [
|
$settings = Stub::make($this->controller, [
|
||||||
'settings_repository' => $this->make(SettingsRepository::class, [
|
'settingsRepository' => $this->make(SettingsRepository::class, [
|
||||||
'findOneByName' => null,
|
'findOneByName' => null,
|
||||||
'findAll' => [],
|
'findAll' => [],
|
||||||
]),
|
]),
|
||||||
|
@ -32,7 +32,7 @@ class UserFlagsControllerTest extends \MailPoetTest {
|
|||||||
$this->currentUserId = $currentUserId;
|
$this->currentUserId = $currentUserId;
|
||||||
$this->userFlagsRepository = $this->diContainer->get(UserFlagsRepository::class);
|
$this->userFlagsRepository = $this->diContainer->get(UserFlagsRepository::class);
|
||||||
$this->userFlags = Stub::make(UserFlagsController::class, [
|
$this->userFlags = Stub::make(UserFlagsController::class, [
|
||||||
'user_flags_repository' => $this->userFlagsRepository,
|
'userFlagsRepository' => $this->userFlagsRepository,
|
||||||
'defaults' => [
|
'defaults' => [
|
||||||
'flag_1' => 'default_value_1',
|
'flag_1' => 'default_value_1',
|
||||||
'flag_2' => 'default_value_2',
|
'flag_2' => 'default_value_2',
|
||||||
|
Reference in New Issue
Block a user