Fix tests

[MAILPOET-1571]
This commit is contained in:
Pavel Dohnal
2019-01-15 14:43:16 +01:00
parent 1db75f40fb
commit b66c724c4a
8 changed files with 94 additions and 51 deletions

View File

@@ -13,11 +13,14 @@ use MailPoet\Models\Setting;
class DaemonTest extends \MailPoetTest {
function testItCanExecuteWorkers() {
$daemon = Stub::construct(Daemon::class, [new WorkersFactory(new SendingErrorHandler())], array(
$daemon = Stub::make(Daemon::class, array(
'executeScheduleWorker' => Expected::exactly(1),
'executeQueueWorker' => Expected::exactly(1),
'pauseExecution' => null,
'callSelf' => null
'executeMigrationWorker' => null,
'executeStatsNotificationsWorker' => null,
'executeSendingServiceKeyCheckWorker' => null,
'executePremiumKeyCheckWorker' => null,
'executeBounceWorker' => null,
), $this);
$data = array(
'token' => 123
@@ -27,13 +30,15 @@ class DaemonTest extends \MailPoetTest {
}
function testItCanRun() {
$daemon = Stub::construct(Daemon::class, [new WorkersFactory(new SendingErrorHandler())], array(
'pauseExecution' => null,
$daemon = Stub::make(Daemon::class, array(
// workers should be executed
'executeScheduleWorker' => Expected::exactly(1),
'executeQueueWorker' => Expected::exactly(1),
// daemon should call itself
'callSelf' => Expected::exactly(1),
'executeMigrationWorker' => Expected::exactly(1),
'executeStatsNotificationsWorker' => Expected::exactly(1),
'executeSendingServiceKeyCheckWorker' => Expected::exactly(1),
'executePremiumKeyCheckWorker' => Expected::exactly(1),
'executeBounceWorker' => Expected::exactly(1)
), $this);
$data = array(
'token' => 123