function it_should_read_user_input(OutputInterface $output, Application $application) { $application->run(Argument::that(function (StringInput $value) { return $value->getFirstArgument() === 'all'; }), $output)->shouldBeCalled()->willReturn('retval'); $application->getName()->shouldNotBeCalled(); $this->readline(false); // show prompt when true $application->getName()->shouldBeCalled(); $this->readline(true); }