application = new Application('2.1-dev'); $this->application->setAutoExit(false); $this->setFixedTerminalDimensions(); $this->tester = new ApplicationTester($this->application); $this->setupReRunner(); $this->setupPrompter(); $this->resetShellVerbosity(); } private function setFixedTerminalDimensions() { putenv('COLUMNS=130'); putenv('LINES=30'); } private function setupPrompter() { $this->prompter = new Prompter(); $this->application->getContainer()->set('console.prompter', $this->prompter); } private function setupReRunner() { $this->reRunner = new ReRunner; $this->application->getContainer()->set('process.rerunner.platformspecific', $this->reRunner); } private function resetShellVerbosity() { putenv(sprintf('SHELL_VERBOSITY=%d', OutputInterface::VERBOSITY_NORMAL)); } /** * @Given I have started describing the :class class * @Given I start describing the :class class */ public function iDescribeTheClass($class) { $arguments = array( 'command' => 'describe', 'class' => $class ); if ($this->tester->run($arguments, array('interactive' => false)) !== 0) { throw new \Exception('Test runner exited with an error'); } } /** * @When I run phpspec (non interactively) * @When I run phpspec using the :formatter format * @When I run phpspec with the :option option * @When I run phpspec with :spec specs to run * @When /I run phpspec with option (?P