2017-25 © Pedro Peláez
 

library lara-command-test

image

railken/lara-command-test

  • Friday, May 25, 2018
  • by railken
  • Repository
  • 0 Watchers
  • 0 Stars
  • 29 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

lara-command-test

Build Status License, (*1)

A laravel package to call commands that have prompt inputs, (*2)

Simple usage

use Illuminate\Console\Command;

class DummyCommand extends Command
{

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        if ($this->confirm("Should we go?")) {

            $response = $this->ask('Is it hello?');

            return $response === 'Hello' ? 1 : 0;
        }

        return 0;
    }
}

use Railken\LaraCommandTest\Helper;

$helper = new Helper(__DIR__ . "/../var/cache");
$command = $helper->generate(DummyCommand::class, [
    'yes',
    'Hello'
]);
$helper->call($command, []);

The Versions