-
Notifications
You must be signed in to change notification settings - Fork 0
/
code-climate-test-reporter
30 lines (29 loc) · 1.06 KB
/
code-climate-test-reporter
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
#!/usr/bin/env php
<?php
$files = array(
__DIR__ . '/vendor/autoload.php',
__DIR__ . '/../../autoload.php'
);
foreach ($files as $file) {
if (file_exists($file)) {
include_once $file;
define('PHP_TEST_REPORTER_COMPOSER_INSTALL', $file);
break;
}
}
if (!defined('PHP_TEST_REPORTER_COMPOSER_INSTALL')) {
die(
'You need to set up the project dependencies using the following commands:' . PHP_EOL .
'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
'php composer.phar install' . PHP_EOL
);
}
use CodeClimate\Bundle\TestReporterBundle\Version;
use CodeClimate\Bundle\TestReporterBundle\Console\Application;
$rootDir = realpath(dirname(PHP_TEST_REPORTER_COMPOSER_INSTALL) . '/..');
$app = new Application($rootDir, 'Code Climate PHP Test Reporter', Version::VERSION);
// This is only a trick to publish only one Code Coverage Payload to Code Climate, this is important because Code
// Climate does not support multiple payload for now
if (version_compare(phpversion(), '7.0.0', '<')) {
$app->run();
}