Skip to content
Permalink
Browse files

Merge pull request #1 from mrjpsycho/master

Capability to set manual parameters
  • Loading branch information...
mbfisher committed Sep 8, 2015
2 parents 2caa475 + ae88fe4 commit 00bfa982c4502938ca0110d2f23c5cd04ffcbcc3
Showing with 18 additions and 0 deletions.
  1. +11 −0 spec/Task/Plugin/Console/CommandRunnerSpec.php
  2. +7 −0 src/CommandRunner.php
@@ -66,6 +66,17 @@ function it_should_run_a_command_with_options(Application $app, Command $command
$this->run($output);
}
function it_should_run_a_command_with_manually_set_parameters(Application $app, Command $command, InputDefinition $definition, OutputInterface $output)
{
$this->setup($app, $command, $definition);
$this->setParameter('--foo', 'bar');
$input = new ArrayInput(['command' => 'test', '--foo' => 'bar']);
$app->run($input, $output)->shouldBeCalled();
$this->run($output);
}
function it_should_throw_on_unknown_argument(Application $app, Command $command, InputDefinition $definition)
{
$this->setup($app, $command, $definition);
@@ -92,4 +92,11 @@ public function getParameters()
{
return $this->parameters;
}
public function setParameter($param, $value)
{
$this->parameters[$param] = $value;
return $this;
}
}

0 comments on commit 00bfa98

Please sign in to comment.
You can’t perform that action at this time.