PHPSpec2\Console\Command\RunCommand::execute PHP Method

execute() protected method

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->setFormatter(new Console\Formatter($output->isDecorated()));
        $this->io = new Console\IO($input, $output, $this->getHelperSet());
        $presenter = $this->createPresenter();
        $mocker = $this->createMocker();
        $unwrapper = $this->createArgumentsUnwrapper();
        $matchers = $this->createMatchersCollection($presenter, $unwrapper);
        $collector = $this->createStatisticsCollector();
        $formatter = $this->createFormatter($input->getOption('format'), $presenter, $collector);
        $specifications = $this->createLocator()->getSpecifications($input->getArgument('spec'));
        $runner = $this->createRunner($matchers, $mocker, $unwrapper);
        $this->configureAdditionalListeners($input->getOption('src-path'));
        $this->dispatcher->dispatch('beforeSuite', new Event\SuiteEvent($collector));
        $result = 0;
        $startTime = microtime(true);
        foreach ($specifications as $spec) {
            $result = max($result, $runner->runSpecification($spec));
        }
        $this->dispatcher->dispatch('afterSuite', new Event\SuiteEvent(microtime(true) - $startTime, $result));
        return intval(Event\ExampleEvent::PASSED !== $result);
    }