File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change 88use Tempest \Mail \Exceptions \RecipientWasMissing ;
99use Tempest \Mail \Exceptions \SenderWasMissing ;
1010use Tempest \Mail \GenericEmail ;
11- use Tempest \Mail \Mailer ;
12- use Tempest \Mail \Testing \AttachmentTester ;
1311use Tempest \Mail \Transports \NullMailerConfig ;
1412use Tests \Tempest \Integration \FrameworkIntegrationTestCase ;
1513
1614final class MailerTest extends FrameworkIntegrationTestCase
1715{
1816 public function test_event (): void
1917 {
20- $ sent = false ;
21-
22- $ this ->container
23- ->get (EventBus::class)
24- ->listen (function (EmailWasSent $ event ) use (&$ sent ): void {
25- $ sent = $ event ;
26- });
18+ $ this ->eventBus ->preventEventHandling ();
2719
2820 $ this ->mail ->send (new GenericEmail (
2921 subject: 'Hello ' ,
@@ -32,7 +24,7 @@ public function test_event(): void
32243325 ));
3426
35- $ this ->assertInstanceOf (EmailWasSent::class, $ sent );
27+ $ this ->eventBus -> assertDispatched (EmailWasSent::class);
3628 }
3729
3830 public function test_default_sender (): void
You can’t perform that action at this time.
0 commit comments