Skip to content

Commit 68d679b

Browse files
authored
Reduce line count to fix static testing
1 parent 7df183b commit 68d679b

File tree

1 file changed

+10
-30
lines changed

1 file changed

+10
-30
lines changed

app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -764,22 +764,17 @@ function ($callback) {
764764
->method('getCollection')->willReturn($this->scheduleCollectionMock);
765765
$scheduleMock->expects($this->any())
766766
->method('getResource')->willReturn($this->scheduleResourceMock);
767-
$this->scheduleFactoryMock->expects($this->once(2))
767+
$this->scheduleFactoryMock->expects($this->once())
768768
->method('create')->willReturn($scheduleMock);
769769

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

774-
$this->objectManagerMock->expects(
775-
$this->once()
776-
)->method(
777-
'create'
778-
)->with(
779-
'CronJob'
780-
)->willReturn(
781-
$testCronJob
782-
);
774+
$this->objectManagerMock->expects($this->once())
775+
->method('create')
776+
->with('CronJob')
777+
->willReturn($testCronJob);
783778

784779
$this->cronQueueObserver->execute($this->observerMock);
785780
}
@@ -1055,26 +1050,11 @@ public function testMissedJobsCleanedInTime()
10551050
$connectionMock->expects($this->exactly(5))
10561051
->method('delete')
10571052
->withConsecutive(
1058-
[
1059-
$tableName,
1060-
['status = ?' => 'pending', 'job_code in (?)' => ['test_job1']]
1061-
],
1062-
[
1063-
$tableName,
1064-
['status = ?' => 'success', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]
1065-
],
1066-
[
1067-
$tableName,
1068-
['status = ?' => 'missed', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]
1069-
],
1070-
[
1071-
$tableName,
1072-
['status = ?' => 'error', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]
1073-
],
1074-
[
1075-
$tableName,
1076-
['status = ?' => 'pending', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]
1077-
]
1053+
[$tableName, ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1']]],
1054+
[$tableName, ['status = ?' => 'success', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]],
1055+
[$tableName, ['status = ?' => 'missed', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]],
1056+
[$tableName, ['status = ?' => 'error', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]],
1057+
[$tableName, ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]]
10781058
)
10791059
->willReturn(1);
10801060

0 commit comments

Comments
 (0)