-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Description
Laravel Version
Since 12.25.0
PHP Version
8.4
Description
Using pending attribute in schedule group doesn't work as expected.
If I remove clone
from #56677, both test cases passes.
But in 12.25, second test case failed.
Should I always start with command
to create an Event object in schedule group? or pending attributes are expected in group?
Steps To Reproduce
test('command before at', function () {
$schedule = new ScheduleClass;
$schedule->weekdays()
->group(function (ScheduleClass $schedule) {
$schedule->command('inspire')->at('01:00');
});
$events = $schedule->events();
$this->assertSame('0 1 * * 1-5', $events[0]->expression); // this works.
});
test('at before command', function () {
$schedule = new ScheduleClass;
$schedule->weekdays()
->group(function (ScheduleClass $schedule) {
$schedule->at('01:00')->command('inspire');
});
$events = $schedule->events();
$this->assertSame('0 1 * * 1-5', $events[0]->expression);
// in 12.25 it becomes * * * * 1-5 and fails
});
Metadata
Metadata
Assignees
Labels
No labels