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); }