-
Notifications
You must be signed in to change notification settings - Fork 25
/
.atoum.php
44 lines (35 loc) · 1.19 KB
/
.atoum.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 mageekguy\atoum;
use mageekguy\atoum\reports;
use mageekguy\atoum\writers\std;
define('TEST_ROOT', __DIR__ . DIRECTORY_SEPARATOR . 'tests');
function colorized() {
$color = -1;
if(false !== ($term = getenv('TERM'))) {
if(preg_match('/\d+/', $term, $matches) > 0) {
$color = $matches[0];
}
}
if($color < 0) {
$color = system('tput colors 2> /dev/null');
}
return ($color >= 256);
}
if(colorized()) {
$script
->addDefaultReport()
->addField(new atoum\report\fields\runner\atoum\logo())
->addField(new atoum\report\fields\runner\result\logo())
;
}
$script->noCodeCoverageForNamespaces('mageekguy');
$runner->addTestsFromDirectory(TEST_ROOT . DIRECTORY_SEPARATOR . 'units');
if (file_exists(__DIR__ . '/vendor/autoload.php') === true) {
require_once __DIR__ . '/vendor/autoload.php';
}
if (class_exists('mageekguy\atoum\reports\telemetry') === true && version_compare(phpversion(), '5.5.0', '>=')) {
$telemetry = new reports\telemetry();
$telemetry->readProjectNameFromComposerJson(__DIR__ . '/composer.json');
$telemetry->addWriter(new std\out());
$runner->addReport($telemetry);
}