-
Notifications
You must be signed in to change notification settings - Fork 7
/
peridot.php
44 lines (38 loc) · 1.54 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
38
39
40
41
42
43
44
<?php
use Evenement\EventEmitterInterface;
use Peridot\Console\Environment;
use Peridot\Plugin\Prophecy\ProphecyPlugin;
use Peridot\Plugin\Watcher\WatcherPlugin;
use Peridot\Reporter\CodeCoverage\AbstractCodeCoverageReporter;
use Peridot\Reporter\CodeCoverageReporters;
use Peridot\Reporter\Dot\DotReporterPlugin;
use Peridot\Reporter\ListReporter\ListReporterPlugin;
use Peridot\Concurrency\ConcurrencyPlugin;
use Symfony\Component\Console\Input\InputInterface;
return function(EventEmitterInterface $emitter) {
$watcher = new WatcherPlugin($emitter);
$dot = new DotReporterPlugin($emitter);
$list = new ListReporterPlugin($emitter);
$concurrency = new ConcurrencyPlugin($emitter);
$prophecy = new ProphecyPlugin($emitter);
if (getenv('FULLSUITE')) {
//running the entire suite with integration tests eats computers
ini_set('memory_limit', '512M');
}
$emitter->on('peridot.start', function (Environment $env) {
$definition = $env->getDefinition();
$definition->getArgument('path')->setDefault('specs');
});
// disable watcher for concurrency workers
$emitter->on('peridot.execute', function (InputInterface $input) {
$token = getenv('PERIDOT_TEST_TOKEN');
if ($token) {
$input->setOption('watch', false);
}
});
$coverage = new CodeCoverageReporters($emitter);
$coverage->register();
$emitter->on('code-coverage.start', function (AbstractCodeCoverageReporter $reporter) {
$reporter->addDirectoryToWhitelist(__DIR__ . '/src');
});
};