Add running PHP unit test coverage reports in CircleCI

This commit is contained in:
Tautvidas Sipavičius
2016-08-25 00:34:58 +03:00
parent 3929efbdd9
commit efc5c34bf9
2 changed files with 19 additions and 6 deletions

View File

@ -114,15 +114,20 @@ class RoboFile extends \Robo\Tasks {
$this->_exec($command);
}
function testCoverage($file = null) {
function testCoverage($opts=['file' => null, 'xml' => false]) {
$this->loadEnv();
$this->_exec('vendor/bin/codecept build');
$this->_exec(join(' ', array(
$command = join(' ', array(
'vendor/bin/codecept run',
(($file) ? $file : ''),
(($opts['file']) ? $opts['file'] : ''),
'--coverage',
'--coverage-html'
)));
($opts['xml']) ? '--coverage-xml' : '--coverage-html'
));
if($opts['xml']) {
$command .= ' --xml';
}
$this->_exec($command);
}
function testJavascript($xml_output_file = null) {