-
Notifications
You must be signed in to change notification settings - Fork 0
/
peridot.php
37 lines (30 loc) · 1.11 KB
/
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
29
30
31
32
33
34
35
36
37
<?php
use Evenement\EventEmitterInterface;
use Peridot\Concurrency\ConcurrencyPlugin;
use Peridot\Console\Environment;
use Peridot\Plugin\Watcher\WatcherPlugin;
use Peridot\Reporter\CodeCoverageReporters;
use Peridot\Reporter\Dot\DotReporterPlugin;
use Peridot\Reporter\ListReporter\ListReporterPlugin;
use Symfony\Component\Console\Input\InputInterface;
error_reporting(-1);
return function (EventEmitterInterface $emitter) {
new WatcherPlugin($emitter);
new DotReporterPlugin($emitter);
new ListReporterPlugin($emitter);
new ConcurrencyPlugin($emitter);
// set the default path
$emitter->on('peridot.start', function (Environment $environment) {
$environment->getDefinition()
->getArgument('path')->setDefault('specs');
});
// disable watcher for concurrency workers
$emitter->on('peridot.execute', function (InputInterface $input) {
if (getenv('PERIDOT_TEST_TOKEN')) {
$input->setOption('watch', false);
}
});
$coverage = new CodeCoverageReporters($emitter);
$coverage->register();
//$prophecy = new ProphecyPlugin($emitter);
};