protected function execute(InputInterface $input, OutputInterface $output) { $output->getFormatter()->setStyle('success', new OutputFormatterStyle('green')); $output->getFormatter()->setStyle('failure', new OutputFormatterStyle('red')); $output->getFormatter()->setStyle('info', new OutputFormatterStyle('blue')); $output->getFormatter()->setStyle('skipped', new OutputFormatterStyle('magenta')); $output->getFormatter()->setStyle('incomplete', new OutputFormatterStyle('magenta')); $output->getFormatter()->setStyle('u', new OutputFormatterStyle(null, null, array('underscore'))); $output->getFormatter()->setStyle('suite', new OutputFormatterStyle('yellow', null)); $output->getFormatter()->setStyle('bold', new OutputFormatterStyle('blue', null)); // Argument parsing // ################ $path = $input->getArgument('path'); $printer_options = array('trace_depth' => $input->getOption('trace_depth') ?: $this->defaults['trace_depth']); // Configure Output Modules // ######################## $printer = new Printer($printer_options); // Stash these for our event handler. $this->output = $output; $this->printer = $printer; $options = array(); if ($include = $input->getOption('include')) { $options['include'] = "/{$include}/"; } if ($exclude = $input->getOption('exclude')) { $options['exclude'] = "/{$exclude}/"; } if ($grep = $input->getOption('grep')) { $options['grep'] = "/{$grep}/i"; } // Bootstrap and Run // ################# $test_runner = new TestRunner($path, $options); $test_runner->addListener($this); Matura::init(); $code = $test_runner->run()->isSuccessful() ? 0 : 1; Matura::cleanup(); return $code; }
protected function execute(InputInterface $input, OutputInterface $output) { Matura::exportDSL(); }