DEV Community

Discussion on: How To Setup Testing Environment For Laravel Console Packages?

Collapse
 
ahmedash95 profile image
Ahmed Ashraf • Edited

Hey, in laravel docs there is a page for how you can write tests for your cli commands laravel.com/docs/5.8/console-tests hope that help you.

or clarify the problem more :)

Collapse
 
junaidqadir profile image
Junaid Qadir

It certainly will work when you are code is inside the Laravel app. But I'm working on a Laravel CLI package. most of the big names like Spatie, Tighten etc use testbench and I couldn't make it work.

What testbench does is that it installs Laravel and makes it available to the package under development. And I couldn't find any help how to configure the Laravel that comes with testbench.

Most of the tutorials I found only talk about basic stuff and don't dig deeper.

Collapse
 
ahmedash95 profile image
Ahmed Ashraf

In that case what I would advice is to have laravel app that requires your package from local path and you try your package from it. or if you don't mind share the package and I will try to install the testbench for u

Thread Thread
 
junaidqadir profile image
Junaid Qadir • Edited

I have that setup but that's not a practical aaproach I want my packages to be standalone while in development so that I can run tests without being installed inside an app