File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 33namespace DirectoryTree \ImapEngine \Laravel \Tests ;
44
55use DirectoryTree \ImapEngine \Laravel \Commands \WatchMailbox ;
6+ use DirectoryTree \ImapEngine \Laravel \Events \MessageReceived ;
67use DirectoryTree \ImapEngine \Laravel \Facades \Imap ;
78use DirectoryTree \ImapEngine \Laravel \Support \LoopFake ;
89use DirectoryTree \ImapEngine \Laravel \Support \LoopInterface ;
910use DirectoryTree \ImapEngine \Testing \FakeFolder ;
11+ use DirectoryTree \ImapEngine \Testing \FakeMessage ;
1012use Illuminate \Support \Facades \App ;
1113use Illuminate \Support \Facades \Config ;
14+ use Illuminate \Support \Facades \Event ;
1215use InvalidArgumentException ;
1316
1417use function Pest \Laravel \artisan ;
3033 ]);
3134
3235 Imap::fake ('test ' , folders: [
33- new FakeFolder ('inbox ' ),
36+ new FakeFolder ('inbox ' , messages: [
37+ $ message = new FakeMessage (uid: 1 ),
38+ ]),
3439 ]);
3540
3641 App::bind (LoopInterface::class, LoopFake::class);
3742
43+ Event::fake ();
44+
3845 artisan (WatchMailbox::class, ['mailbox ' => 'test ' ])->assertSuccessful ();
46+
47+ Event::assertDispatched (
48+ fn (MessageReceived $ event ) => $ event ->message ->is ($ message )
49+ );
3950});
You can’t perform that action at this time.
0 commit comments