Are you trying to test the functionality that gives rise to the Event or the Event itself?
As ever, @adamwathan is the go-to resource for testing... https://adamwathan.me/2016/08/15/three-approaches-to-testing-events-in-laravel/
Hi all,
I'm looking to unit test with phpunit my event's process that record logs in database but facing some trouble :
In unit test, no event seam to be fired and so my log test table stay empty. I know that in prod en dev it's working because as event is well fired and on event a new record is created in db. I can test other db recording process without problem, but only event action seam to not be fired and my log actions table stay empty.... All other tables are well populate.
Is something special with event process to unit test with phpunit or doese use a particular process ??
I'm using laravel 5.4 with phpunit from vendor/bin/phpunit as 5.7.20.
Thank's for your help.
fbm
Please or to participate in this conversation.