spiritix / lada-cache

A Redis based, fully automated and scalable database cache layer for Laravel
MIT License
538 stars 68 forks source link

How to load service provider during unit tests? #94

Closed xwiz closed 4 years ago

xwiz commented 4 years ago

I noticed that if I have a seeder in my phpunit boostrap that invokes Eloquent, I get a Target lada.handler not found indicating the QueryHandler was not bound. What is the best way to fix this?

xwiz commented 4 years ago

Actually any eloquent DB transaction in unit tests leads to this same issue. Laravel 6.x, Version 4.0.2

xwiz commented 4 years ago

Sorry was some Kinda weird autoload issue. Fixed by adding clear-compiled from test boostrap.