Exemple #1
0
 function let()
 {
     $command = new Command('name');
     $command->argument(ArgumentType::SINGLE, 'arg1')->setValue('val1');
     $command->argument(ArgumentType::SINGLE, 'arg2');
     $command->option(ArgumentType::SINGLE, '--opt1')->setValue('val2');
     $command->option(ArgumentType::SINGLE, null, '-o')->setValue('val3');
     $command->option(ArgumentType::SINGLE, '--opt2');
     $this->beConstructedWith($command);
 }
 function it_renders()
 {
     $command = new Command();
     $command->argument(ArgumentType::SINGLE, 'single');
     $command->argument(ArgumentType::SINGLE_OPTIONAL, 'single_optional');
     $command->argument(ArgumentType::MULTIPLE, 'multiple');
     $command->argument(ArgumentType::MULTIPLE_OPTIONAL, 'multiple_optional');
     $input = new Input();
     $output = new Output();
     $output->setEnableBuffering(true);
     $this->beConstructedWith($input, $output);
     $this->render($command);
 }
 function it_renders()
 {
     $command = new Command();
     $command->argument(ArgumentType::SINGLE, 'arg1');
     $command->argument(ArgumentType::SINGLE_OPTIONAL, 'arg2');
     $command->argument(ArgumentType::MULTIPLE, 'arg3');
     $command->argument(ArgumentType::MULTIPLE_OPTIONAL, 'arg4');
     $command->option(OptionType::SINGLE, '--opt1', '-1');
     $command->option(OptionType::SINGLE_OPTIONAL, '--opt2', '-2');
     $command->option(OptionType::MULTIPLE, '--opt3', '-3');
     $command->option(OptionType::MULTIPLE_OPTIONAL, '--opt4', '-4');
     $command->option(OptionType::BOOLEAN, '--opt5', '-5');
     $command->option(OptionType::INCREMENTAL, '--opt6', '-6');
     $input = new Input();
     $output = new Output();
     $output->setEnableBuffering(true);
     $this->beConstructedWith($input, $output);
     $this->render($command);
 }