8000 minor #51274 [Scheduler] fix tests (xabbuh) · symfony/symfony@00703b0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 00703b0

Browse files
committed
minor #51274 [Scheduler] fix tests (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- [Scheduler] fix tests | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yno | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Commits ------- 0567ed8 fix tests
2 parents 537925a + 0567ed8 commit 00703b0

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

src/Symfony/Component/Scheduler/Tests/Command/DebugCommandTest.php

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testExecuteWithoutSchedules()
4242
$this->assertSame("\nScheduler\n=========\n\n [ERROR] No schedules found.{$filler}\n\n", $tester->getDisplay(true));
4343
}
4444

45-
public function testExecuteWithScheduleWithoutTriggerShowingNoNextRun()
45+
public function testExecuteWithScheduleWithoutTriggerDoesNotDisplayMessage()
4646
{
4747
$schedule = new Schedule();
4848
$schedule->add(RecurringMessage::trigger(new CallbackTrigger(fn () => null, 'test'), new \stdClass()));
@@ -64,6 +64,41 @@ public function testExecuteWithScheduleWithoutTriggerShowingNoNextRun()
6464

6565
$tester->execute([], ['decorated' => false]);
6666

67+
$this->assertSame("\n".
68+
"Scheduler\n".
69+
"=========\n".
70+
"\n".
71+
"schedule_name\n".
72+
"-------------\n".
73+
"\n".
74+
" --------- --------- ---------- \n".
75+
" Message Trigger Next Run \n".
76+
" --------- --------- ---------- \n".
77+
"\n", $tester->getDisplay(true));
78+
}
79+
80+
public function testExecuteWithScheduleWithoutTriggerShowingNoNextRunWithAllOption()
81+
{
82+
$schedule = new Schedule();
83+
$schedule->add(RecurringMessage::trigger(new CallbackTrigger(fn () => null, 'test'), new \stdClass()));
84+
85+
$schedules = $this->createMock(ServiceProviderInterface::class);
86+
$schedules
87+
->expects($this->once())
88+
->method('getProvidedServices')
89+
->willReturn(['schedule_name' => $schedule])
90+
;
91+
$schedules
92+
->expects($this->once())
93+
->method('get')
94+
->willReturn($schedule)
95+
;
96+
97+
$command = new DebugCommand($schedules);
98+
$tester = new CommandTester($command);
99+
100+
$tester->execute(['--all' => true], ['decorated' => false]);
101+
67102
$this->assertSame("\n".
68103
"Scheduler\n".
69104
"=========\n".

0 commit comments

Comments
 (0)
0