Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DumitracheAdrian committed Apr 19, 2024
1 parent 752312d commit 0c94b7f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/cron-job/Tests/CronJobProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,29 @@ public function testProcess(
?string $overwrittenCommand,
string $expectedProcessCommand
): void {
$returnedPreCronJobExecutionEvent = new PreCronJobExecutionEvent(
$execution = $this->createCronJobExecution($command)
);

if (null !== $overwrittenCommand) {
$returnedPreCronJobExecutionEvent->setCommand($overwrittenCommand);
}

$this->eventDispatcher
->expects(static::exactly(2))
->method('dispatch')
->with(
...static::withConsecutive(
[
new PreCronJobExecutionEvent($execution = $this->createCronJobExecution($command)),
new PreCronJobExecutionEvent($execution),
],
[
$postExecutionEvent = new PostCronJobExecutionEvent($execution),
]
)
)
->willReturnOnConsecutiveCalls(
new PreCronJobExecutionEvent($execution, command: $overwrittenCommand),
$returnedPreCronJobExecutionEvent,
$postExecutionEvent
);

Expand Down

0 comments on commit 0c94b7f

Please sign in to comment.