Closed
Description
- Laravel Version: 8.36.2
- PHP Version: 7.4.12
Description:
I am creating a simple test to make sure verification email is sent upon successful registration. According to documentaion, I am suppose to use assertListening
.
e.g.
Event::assertListening(
OrderShipped::class,
[SendShipmentNotification::class, 'handle']
);
Steps To Reproduce:
public function test_send_verification_email_on_registered_event()
{
Event::fake();
// throws error
Event::assertListening(Registered::class, [SendEmailVerificationNotification::class, 'handle']);
// Instead this works. Both the params must be strings
Event::assertListening(Registered::class, SendEmailVerificationNotification::class);
}
Am I missing something from void assertListening(string $expectedEvent, string $expectedListener)?
Metadata
Metadata
Assignees
Labels
No labels