pest icon indicating copy to clipboard operation
pest copied to clipboard

[Bug]: Laravel preset architecture test expect Event Subscriber to have method `handle`

Open jhhazelaar opened this issue 1 year ago • 0 comments

What Happened

When using the laravel preset architecture in the test and you define an event subscriber the test fails, because preset expect event to have handle method.

You can define event subscriber in the listeners folder as defined in de documentation: https://laravel.com/docs/11.x/events#event-subscribers. Now the present gives this error:

Expecting 'app/Listeners/UserEventSubscriber.php' to have method 'handle'.

Maybe ignore the suffix Subscriber in the Listener folder?

How to Reproduce

Create event subscriber in listener folder and use laravel preset.

Sample Repository

No response

Pest Version

3.7.1

PHP Version

8.4.2

Operation System

macOS

Notes

No response

jhhazelaar avatar Jan 03 '25 15:01 jhhazelaar