Exemplo n.º 1
0
 * @copyright 2015 © donbstringham
 * @license   MIT
 * @version   $Revision$
 * @link      http://donbstringham.us
 * $LastChangedDate$
 * $LastChangedBy$
 */
use Evenement\EventEmitterInterface;
use Peridot\Concurrency\ConcurrencyPlugin;
use Peridot\Console\Environment;
use Peridot\Plugin\Prophecy\ProphecyPlugin;
use Peridot\Reporter\CodeCoverageReporters;
use Peridot\Reporter\CodeCoverage\AbstractCodeCoverageReporter;
use Peridot\Reporter\Dot\DotReporterPlugin;
return function (EventEmitterInterface $emitter) {
    $concurrency = new ConcurrencyPlugin($emitter);
    $coverage = new CodeCoverageReporters($emitter);
    $dot = new DotReporterPlugin($emitter);
    $prophecy = new ProphecyPlugin($emitter);
    $emitter->on('peridot.start', function (Environment $environment) {
        $path = $environment->getDefinition()->getArgument('path');
        $path->setDefault('specs');
    });
    $emitter->on('code-coverage.start', function (AbstractCodeCoverageReporter $reporter) {
        $reporter->addDirectoryToWhitelist(__DIR__ . '/src');
        $reporter->addDirectoryToBlacklist(__DIR__ . '/vendor');
        $reporter->addDirectoryToBlacklist(__DIR__ . '/specs');
        $reporter->addFileToBlacklist(__DIR__ . '/peridot.php');
    });
    $coverage->register();
};
Exemplo n.º 2
0
<?php

use Eloquent\Asplode\Asplode;
use Eloquent\Peridot\Phony\PeridotPhony;
use Evenement\EventEmitterInterface;
use Peridot\Console\Environment;
use Peridot\Reporter\CodeCoverageReporters;
use Peridot\Reporter\ReporterInterface;
Asplode::install();
return function (EventEmitterInterface $emitter) {
    PeridotPhony::install($emitter);
    $reporter = new CodeCoverageReporters($emitter);
    $reporter->register();
    $emitter->on('peridot.start', function (Environment $environment) {
        $environment->getDefinition()->getArgument('path')->setDefault('test/suite');
    });
    $emitter->on('code-coverage.start', function (ReporterInterface $reporter) {
        $reporter->addDirectoryToWhitelist(__DIR__ . '/src');
    });
};