Replace constant in tests
[MAILPOET-2367]
This commit is contained in:
committed by
Jack Kitterhing
parent
1bedf1fd1a
commit
910b62cd70
@@ -258,7 +258,7 @@ class CronHelperTest extends \MailPoetTest {
|
||||
$time = microtime(true);
|
||||
expect(CronHelper::enforceExecutionLimit($time))->null();
|
||||
try {
|
||||
CronHelper::enforceExecutionLimit($time - CronHelper::DAEMON_EXECUTION_LIMIT);
|
||||
CronHelper::enforceExecutionLimit($time - CronHelper::getDaemonExecutionLimit());
|
||||
self::fail('Execution limit exception not thrown.');
|
||||
} catch (\Exception $e) {
|
||||
expect($e->getMessage())->equals('Maximum execution time has been reached.');
|
||||
|
@@ -95,8 +95,8 @@ class DaemonHttpRunnerTest extends \MailPoetTest {
|
||||
$daemon = $this->makeEmpty(Daemon::class);
|
||||
$daemon_http_runner = $this->make(DaemonHttpRunner::class, [
|
||||
'pauseExecution' => Expected::exactly(1, function($pause_delay) {
|
||||
expect($pause_delay)->lessThan(CronHelper::DAEMON_EXECUTION_LIMIT);
|
||||
expect($pause_delay)->greaterThan(CronHelper::DAEMON_EXECUTION_LIMIT - 1);
|
||||
expect($pause_delay)->lessThan(CronHelper::getDaemonExecutionLimit());
|
||||
expect($pause_delay)->greaterThan(CronHelper::getDaemonExecutionLimit() - 1);
|
||||
}),
|
||||
'callSelf' => null,
|
||||
'terminateRequest' => null,
|
||||
|
@@ -95,7 +95,7 @@ class InactiveSubscribersTest extends \MailPoetTest {
|
||||
'reactivateInactiveSubscribers' => Stub\Expected::never(),
|
||||
], $this);
|
||||
|
||||
$worker = new InactiveSubscribers($controller_mock, $this->settings, microtime(true) - (CronHelper::DAEMON_EXECUTION_LIMIT - 1));
|
||||
$worker = new InactiveSubscribers($controller_mock, $this->settings, microtime(true) - (CronHelper::getDaemonExecutionLimit() - 1));
|
||||
sleep(1);
|
||||
$this->setExpectedException(\Exception::class, 'Maximum execution time has been reached.');
|
||||
$worker->processTaskStrategy(ScheduledTask::createOrUpdate([]));
|
||||
|
@@ -32,7 +32,7 @@ class SchedulerTest extends \MailPoetTest {
|
||||
|
||||
function testItThrowsExceptionWhenExecutionLimitIsReached() {
|
||||
try {
|
||||
$scheduler = new Scheduler($this->makeEmpty(SubscribersFinder::class), microtime(true) - CronHelper::DAEMON_EXECUTION_LIMIT);
|
||||
$scheduler = new Scheduler($this->makeEmpty(SubscribersFinder::class), microtime(true) - CronHelper::getDaemonExecutionLimit());
|
||||
self::fail('Maximum execution time limit exception was not thrown.');
|
||||
} catch (\Exception $e) {
|
||||
expect($e->getMessage())->equals('Maximum execution time has been reached.');
|
||||
@@ -540,7 +540,7 @@ class SchedulerTest extends \MailPoetTest {
|
||||
$scheduler = Stub::make(Scheduler::class, [
|
||||
'processPostNotificationNewsletter' => Expected::exactly(1),
|
||||
], $this);
|
||||
$scheduler->timer = microtime(true) - CronHelper::DAEMON_EXECUTION_LIMIT;
|
||||
$scheduler->timer = microtime(true) - CronHelper::getDaemonExecutionLimit();
|
||||
try {
|
||||
$scheduler->process();
|
||||
self::fail('Maximum execution time limit exception was not thrown.');
|
||||
|
@@ -38,8 +38,8 @@ class SimpleWorkerTest extends \MailPoetTest {
|
||||
|
||||
function testItThrowsExceptionWhenExecutionLimitIsReached() {
|
||||
try {
|
||||
$worker = new MockSimpleWorker(
|
||||
microtime(true) - CronHelper::DAEMON_EXECUTION_LIMIT
|
||||
new MockSimpleWorker(
|
||||
microtime(true) - CronHelper::getDaemonExecutionLimit()
|
||||
);
|
||||
self::fail('Maximum execution time limit exception was not thrown.');
|
||||
} catch (\Exception $e) {
|
||||
|
Reference in New Issue
Block a user