Skip subscribes deactivation when tracking is disabled
[MAILPOET-1791]
This commit is contained in:
committed by
M. Shull
parent
b04e235171
commit
8be29b0863
@ -17,6 +17,7 @@ class InactiveSubscribersTest extends \MailPoetTest {
|
||||
function _before() {
|
||||
$this->settings = new SettingsController();
|
||||
\ORM::raw_execute('TRUNCATE ' . ScheduledTask::$_table);
|
||||
$this->settings->set('tracking.enabled', true);
|
||||
parent::_before();
|
||||
}
|
||||
|
||||
@ -38,6 +39,18 @@ class InactiveSubscribersTest extends \MailPoetTest {
|
||||
expect($task->scheduled_at)->greaterThan(new Carbon());
|
||||
}
|
||||
|
||||
function testItDoesNotRunWhenTrackingIsDisabled() {
|
||||
$this->settings->set('deactivate_subscriber_after_inactive_days', 10);
|
||||
$this->settings->set('tracking.enabled', false);
|
||||
$controller_mock = Stub::make(InactiveSubscribersController::class, [
|
||||
'markInactiveSubscribers' => Stub\Expected::never(),
|
||||
'markActiveSubscribers' => Stub\Expected::never(),
|
||||
], $this);
|
||||
|
||||
$worker = new InactiveSubscribers($controller_mock, $this->settings);
|
||||
$worker->processTaskStrategy(ScheduledTask::createOrUpdate([]));
|
||||
}
|
||||
|
||||
function testItSchedulesNextRunWhenFinished() {
|
||||
$this->settings->set('deactivate_subscriber_after_inactive_days', 5);
|
||||
$controller_mock = Stub::make(InactiveSubscribersController::class, [
|
||||
|
Reference in New Issue
Block a user