I'm trying to write tests for my laravel package and it depends on Laravel helper dispatch. But package itself don't contains this function.
So I have an error when run tests
Is there a solution for this case? Or should I use DI and inject Illuminate\Contracts\Bus\Dispatcher
instead of using a helper?
Laravel Testing Helper for Packages Development: https://github.com/orchestral/testbench
Package allows to run tests in laravel-like environment. You can use database, facades, helpers etc.
Here is example of real usage: https://github.com/Maatwebsite/Laravel-Excel