Skip to content

Commit c295d8d

Browse files
committed
wip
1 parent 8165f66 commit c295d8d

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

tests/Integration/Mailer/MailerTest.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,14 @@
88
use Tempest\Mail\Exceptions\RecipientWasMissing;
99
use Tempest\Mail\Exceptions\SenderWasMissing;
1010
use Tempest\Mail\GenericEmail;
11-
use Tempest\Mail\Mailer;
12-
use Tempest\Mail\Testing\AttachmentTester;
1311
use Tempest\Mail\Transports\NullMailerConfig;
1412
use Tests\Tempest\Integration\FrameworkIntegrationTestCase;
1513

1614
final 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
3224
3325
));
3426

35-
$this->assertInstanceOf(EmailWasSent::class, $sent);
27+
$this->eventBus->assertDispatched(EmailWasSent::class);
3628
}
3729

3830
public function test_default_sender(): void

0 commit comments

Comments
 (0)