lundi 11 mai 2020

Access Command object in Artisan

Consider an artisan command that loads a helper class to delegate the business logic.

In the test, I would like to override the configuration of the helper class, but when I do the following, in the test:

$artisan = $this->artisan('ACME:load-widgets'); I was hoping $artisan variable would contain a reference to a $command object of some sort, ie the initialized class of the command.

There does not seem to be a clear reference to the actual command's initial object that would allow me to easily call setter methods on the helper class.

Did I miss anything, or is this even possible?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire