-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkahlan-config.php
42 lines (34 loc) · 1.34 KB
/
kahlan-config.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
<?php
use Kahlan\Filter\Filters;
use Kahlan\Reporter\Coverage;
use Kahlan\Reporter\Coverage\Driver\Xdebug;
use Kahlan\Reporter\Coverage\Driver\Phpdbg;
use Kahlan\Reporter\Coverage\Exporter\Clover;
$commandLine = $this->commandLine();
$commandLine->option('ff', 'default', 1);
$commandLine->option('coverage-scrutinizer', 'default', 'scrutinizer.xml');
Filters::apply($this, 'reporting', function($next) {
$reporter = $this->reporters()->get('coverage');
if (!$reporter || !$this->commandLine()->exists('coverage-scrutinizer')) {
return $next();
}
Clover::write([
'collector' => $reporter,
'file' => $this->commandLine()->get('coverage-scrutinizer'),
]);
return $next();
});
Filters::apply($this, 'coverage', function($next) {
if (!extension_loaded('xdebug') && PHP_SAPI !== 'phpdbg') {
return;
}
$reporters = $this->reporters();
$coverage = new Coverage([
'verbosity' => $this->commandLine()->get('coverage'),
'driver' => PHP_SAPI !== 'phpdbg' ? new Xdebug() : new Phpdbg(),
'path' => $this->commandLine()->get('src'),
'colors' => !$this->commandLine()->get('no-colors')
]);
$reporters->add('coverage', $coverage);
});
require_once realpath(rtrim(getcwd(), '\\/ ')) . DIRECTORY_SEPARATOR . 'spec' . DIRECTORY_SEPARATOR . 'bootstrap.php';