forked from recoilphp/recoil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
peridot.php
28 lines (21 loc) · 887 Bytes
/
peridot.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
declare(strict_types=1); // @codeCoverageIgnore
use Evenement\EventEmitterInterface;
use Peridot\Console\Environment;
use Peridot\Reporter\CodeCoverage\AbstractCodeCoverageReporter;
use Peridot\Reporter\CodeCoverageReporters;
use Recoil\Dev\Peridot\Plugin;
use Recoil\ReferenceKernel\ReferenceKernel;
require __DIR__ . '/vendor/autoload.php';
return function (EventEmitterInterface $emitter) {
(new CodeCoverageReporters($emitter))->register();
Plugin::install($emitter, function () {
return ReferenceKernel::create();
});
$emitter->on('peridot.start', function (Environment $environment) {
$environment->getDefinition()->getArgument('path')->setDefault('test/suite');
});
$emitter->on('code-coverage.start', function (AbstractCodeCoverageReporter $reporter) {
$reporter->addDirectoryToWhitelist(__DIR__ . '/src');
});
};