/** * @Given /^I run phpspec$/ */ public function iRunPhpspec() { $application = new Application('2.0-dev'); $application->setAutoExit(false); $this->applicationTester = new ApplicationTester($application); $this->applicationTester->run('run --no-interaction -f pretty'); }
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); }
/** * @throws \Exception * @group phpspec */ public function testShouldPassPhpSpecTest() { try { $app = new Application('phpguard-listen-spec'); $app->setAutoExit(false); $app->setCatchExceptions(true); $input = new StringInput('run --ansi'); $return = $app->run($input); $this->assertEquals(0, $return, 'PhpGuard Spec Testing is not passed.'); } catch (\Exception $e) { throw $e; } }
/** * Override setup commands * * Add Bridge\RunCommand * @param ServiceContainer $container */ protected function setupCommands(ServiceContainer $container) { BaseApplication::setupCommands($container); $container->setShared('console.commands.run', function ($c) { return new RunCommand(); }); }
/** * @return \Symfony\Component\Console\Helper\DialogHelper */ private function getDialogHelper() { $dialogHelper = $this->application->getHelperSet()->get('dialog'); if (!$dialogHelper instanceof DialogHelper) { throw new RuntimeException('Cannot get DialogHelper from Application'); } return $dialogHelper; }
/** * @return ApplicationTester */ private function createApplicationTester() { $application = new Application('2.1-dev'); $application->setAutoExit(false); return new ApplicationTester($application); }
private function setupReRunner() { $this->reRunner = new ReRunner(); $this->application->getContainer()->set('process.rerunner.platformspecific', $this->reRunner); }
private function setupPrompter() { $this->prompter = new Prompter(); $this->application->getContainer()->set('console.prompter', $this->prompter); }
/** * @return ApplicationTester */ private function createApplicationTester() { $application = new Application('version'); $application->setAutoExit(false); $application->getHelperSet()->set(new YesDialogHelper()); return new ApplicationTester($application); }