function it_should_run_commands(Project $project, Command $foo, Command $bar, InputInterface $input, OutputInterface $output) { $foo->getName()->willReturn('foo'); $bar->getName()->willReturn('bar'); $project->resolveDependencies(Argument::any())->willReturn([]); $project->get('foo')->willReturn($foo); $project->get('bar')->willReturn($bar); $this->beConstructedWith('test', $project, ['foo', 'bar']); $foo->run($input, $output)->shouldBeCalled(); $bar->run($input, $output)->shouldBeCalled(); $this->execute($input, $output); }
function it_should_run_a_task_on_demand(Project $project, HelperSet $helperSet, Command $command, InputInterface $input, Output $output) { $project->get('test')->willReturn($command); $this->setIO($input, $output); $project->getHelperSet()->willReturn($helperSet); $this->setApplication($project); $project->runTask('test', $input, $output)->shouldBeCalled(); $this->runTask('test', $output, $input); }