14
14
use PHPUnit \Framework \TestCase ;
15
15
use Symfony \Component \Cache \Adapter \ArrayAdapter ;
16
16
use Symfony \Component \Clock \ClockInterface ;
17
+ use Symfony \Component \EventDispatcher \EventDispatcher ;
17
18
use Symfony \Component \Scheduler \Generator \MessageContext ;
18
19
use Symfony \Component \Scheduler \Generator \MessageGenerator ;
19
20
use Symfony \Component \Scheduler \RecurringMessage ;
@@ -39,7 +40,7 @@ public function testGetMessagesFromSchedule(string $startTime, array $runs, arra
39
40
$ schedule [$ i ] = $ this ->createMessage (...$ s );
40
41
}
41
42
}
42
- $ schedule = (new Schedule ())->add (...$ schedule );
43
+ $ schedule = (new Schedule (new EventDispatcher () ))->add (...$ schedule );
43
44
$ schedule ->stateful (new ArrayAdapter ());
44
45
45
46
$ scheduler = new MessageGenerator ($ schedule , 'dummy ' , $ clock );
@@ -77,7 +78,7 @@ public function __construct(private readonly array $schedule)
77
78
78
79
public function getSchedule (): Schedule
79
80
{
80
- $ schedule = (new Schedule ())->add (...$ this ->schedule );
81
+ $ schedule = (new Schedule (new EventDispatcher () ))->add (...$ this ->schedule );
81
82
$ schedule ->stateful (new ArrayAdapter ());
82
83
83
84
return $ schedule ;
@@ -170,7 +171,7 @@ public function testYieldedContext()
170
171
$ clock ->method ('now ' )->willReturnReference ($ now );
171
172
172
173
$ message = $ this ->createMessage ((object ) ['id ' => 'message ' ], '22:13:00 ' , '22:14:00 ' , '22:16:00 ' );
173
- $ schedule = (new Schedule ())->add ($ message );
174
+ $ schedule = (new Schedule (new EventDispatcher () ))->add ($ message );
174
175
$ schedule ->stateful (new ArrayAdapter ());
175
176
176
177
$ scheduler = new MessageGenerator ($ schedule , 'dummy ' , $ clock );
0 commit comments