Skip to content

Commit

Permalink
Reduce line count to fix static testing
Browse files Browse the repository at this point in the history
  • Loading branch information
driskell authored Aug 21, 2020
1 parent 7df183b commit 68d679b
Showing 1 changed file with 10 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -764,22 +764,17 @@ function ($callback) {
->method('getCollection')->willReturn($this->scheduleCollectionMock);
$scheduleMock->expects($this->any())
->method('getResource')->willReturn($this->scheduleResourceMock);
$this->scheduleFactoryMock->expects($this->once(2))
$this->scheduleFactoryMock->expects($this->once())
->method('create')->willReturn($scheduleMock);

$testCronJob = $this->getMockBuilder('CronJob')
->setMethods(['execute'])->getMock();
$testCronJob->expects($this->atLeastOnce())->method('execute')->with($schedule);

$this->objectManagerMock->expects(
$this->once()
)->method(
'create'
)->with(
'CronJob'
)->willReturn(
$testCronJob
);
$this->objectManagerMock->expects($this->once())
->method('create')
->with('CronJob')
->willReturn($testCronJob);

$this->cronQueueObserver->execute($this->observerMock);
}
Expand Down Expand Up @@ -1055,26 +1050,11 @@ public function testMissedJobsCleanedInTime()
$connectionMock->expects($this->exactly(5))
->method('delete')
->withConsecutive(
[
$tableName,
['status = ?' => 'pending', 'job_code in (?)' => ['test_job1']]
],
[
$tableName,
['status = ?' => 'success', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]
],
[
$tableName,
['status = ?' => 'missed', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]
],
[
$tableName,
['status = ?' => 'error', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]
],
[
$tableName,
['status = ?' => 'pending', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]
]
[$tableName, ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1']]],
[$tableName, ['status = ?' => 'success', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]],
[$tableName, ['status = ?' => 'missed', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]],
[$tableName, ['status = ?' => 'error', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]],
[$tableName, ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]]
)
->willReturn(1);

Expand Down

0 comments on commit 68d679b

Please sign in to comment.