/** * Output available reporters * * @param OutputInterface $output */ protected function listReporters(OutputInterface $output) { $output->writeln(""); foreach ($this->factory->getReporters() as $name => $info) { $output->writeln(sprintf(" %s - %s", $name, $info['description'])); } $output->writeln(""); }
/** * Handle the peridot.reporters event. * * @param InputInterface $input * @param ReporterFactory $reporterFactory */ public function onPeridotReporters(InputInterface $input, ReporterFactory $reporterFactory) { $reporterFactory->register('clover-code-coverage', 'Code coverage with a PHP_CodeCoverage style Clover report', 'Peridot\\Reporter\\CodeCoverage\\CloverCodeCoverageReporter'); $reporterFactory->register('crap4j-code-coverage', 'Code coverage with a PHP_CodeCoverage style Crap4J report', 'Peridot\\Reporter\\CodeCoverage\\Crap4JCodeCoverageReporter'); $reporterFactory->register('html-code-coverage', 'Code coverage with a PHP_CodeCoverage style HTML report', 'Peridot\\Reporter\\CodeCoverage\\HTMLCodeCoverageReporter'); $reporterFactory->register('php-code-coverage', 'Code coverage with a PHP_CodeCoverage style PHP report', 'Peridot\\Reporter\\CodeCoverage\\PHPCodeCoverageReporter'); $reporterFactory->register('text-code-coverage', 'Code coverage with a PHP_CodeCoverage style Text report', 'Peridot\\Reporter\\CodeCoverage\\TextCodeCoverageReporter'); $reporterFactory->register('xml-code-coverage', 'Code coverage with a PHP_CodeCoverage style XML report', 'Peridot\\Reporter\\CodeCoverage\\XMLCodeCoverageReporter'); }
/** * Return the result as an integer. * * @return int */ protected function getResult() { $result = new TestResult($this->eventEmitter); $this->getLoader()->load($this->configuration->getPath()); $this->factory->create($this->configuration->getReporter()); $this->runner->run($result); if ($result->getFailureCount() > 0) { return 1; } return 0; }
/** * @param InputInterface $input * @param ReporterFactory $reporters */ public function onPeridotReporters(InputInterface $input, ReporterFactory $reporters) { $reporters->register('dot', 'dot matrix', 'Peridot\\Reporter\\Dot\\DotReporter'); }
$this->emitter->emit('peridot.start', [$this->environment]); }); afterEach(function () { $this->getProphet()->checkPredictions(); }); it('should store a reference to input object', function () { $input = new StringInput(''); $input->bind($this->definition); $this->emitter->emit('peridot.execute', [$input]); expect($this->plugin->getInput())->to->equal($input); }); }); context('when peridot.reporters event is emitted', function () use($configure) { beforeEach($configure); it('should register the concurrency reporter', function () { $factory = new ReporterFactory($this->config, new BufferedOutput(), $this->emitter); $input = new StringInput(''); $this->emitter->emit('peridot.reporters', [$input, $factory]); $reporters = $factory->getReporters(); expect($reporters)->to->have->property('concurrent'); }); }); context('when peridot.load event is emitted', function () use($configure) { beforeEach($configure); beforeEach(function () { $suite = new Suite("suite", function () { }); $configuration = new Configuration(); $runner = new Runner($suite, $configuration, $this->emitter); $factory = new ReporterFactory($configuration, new NullOutput(), $this->emitter); $this->command = new Command($runner, $configuration, $factory, $this->emitter);
/** * Register the concurrency reporter. * * @param InputInterface $input * @param ReporterFactory $reporters * @return void */ public function onPeridotReporters(InputInterface $input, ReporterFactory $reporters) { $reporters->register('concurrent', 'organize files by time to execute', 'Peridot\\Concurrency\\Reporter\\ConcurrentReporter'); }
/** * @param InputInterface $input * @param ReporterFactory $reporters */ public function onPeridotReporters(InputInterface $input, ReporterFactory $reporters) { $reporters->register('list', 'list test results', 'Peridot\\Reporter\\ListReporter\\ListReporter'); }