bjones2015's avatar

How To Test Artisan Commands

I'm wanting to build an Artisan command to clear out some old records every month.

I understand how to build the command, but I'm having trouble with testing it. Using the TestCase class how am I suppose to run the command?

0 likes
2 replies
bjones2015's avatar

Of course as soon as I post this I see the Artisan::call() method.

ifpingram's avatar

as well as $this->artisan('command:name') if you prefer not using the Facades...

1 like

Please or to participate in this conversation.