You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
started to fail: Tests\Feature\Auth\RegistrationTest > new users can register Expected [App\Notifications\WelcomeNotification] to be sent 1 times, but was sent 2 times. Failed asserting that 2 is identical to 1.
While writing this issue I noted that this only occurs if the argument $event in the listener has the explicit type, like handle(Registered $event)
note that the event argument has the explicit 'Registered' type, if I remove it, the test passes again
So it's like the type before $event is dispatching the event again? I mean, this is not the behavior prior v11.9.0, the test pass in v11.8.0 and below.
The text was updated successfully, but these errors were encountered:
Laravel Version
11.10.0
PHP Version
8.3.4
Database Driver & Version
sqlite
Description
Since 11.9.0, the event Registered dispatched on RegisteredUserController is being listened twice, so this test:
started to fail:
Tests\Feature\Auth\RegistrationTest > new users can register Expected [App\Notifications\WelcomeNotification] to be sent 1 times, but was sent 2 times. Failed asserting that 2 is identical to 1.
While writing this issue I noted that this only occurs if the argument $event in the listener has the explicit type, like
handle(Registered $event)
Steps To Reproduce
composer create-project laravel/laravel:^11.9 example-app
composer require laravel/breeze
php artisan breeze:install
php artisan make:notification WelcomeNotification
php artisan make:listener SendWelcomeNotification
So it's like the type before $event is dispatching the event again? I mean, this is not the behavior prior v11.9.0, the test pass in v11.8.0 and below.
The text was updated successfully, but these errors were encountered: