Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix runWithXml()
  • Loading branch information
kenjis committed Nov 14, 2015
1 parent adfbe8c commit 6789144
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 2 additions & 0 deletions app/config/bootstrap.php
Expand Up @@ -21,6 +21,8 @@

// The directory where Composer vendor is located (the one that phpunit was required into)
'composer_vendor_path' => $root . '/vendor',
// The directory where Composer bin is located (where phpunit command is located)
'composer_bin_path' => $root . '/bin',

// The directories where the tests reside
'test_directories' => array(
Expand Down
2 changes: 1 addition & 1 deletion app/config/phpunit.xml
Expand Up @@ -4,7 +4,7 @@

<testsuites>
<testsuite>
<directory>/srv/http/vpu/app/test</directory>
<directory suffix=".php">../test</directory>
</testsuite>
</testsuites>

Expand Down
12 changes: 5 additions & 7 deletions app/lib/VPU.php
Expand Up @@ -524,14 +524,12 @@ public function runWithXml($xml_config)
$html_errors = ini_get('html_errors');
ini_set('html_errors', 0);

$vendor_path = Library::retrieve('composer_vendor_path');
$command = "$vendor_path/bin/phpunit --configuration $xml_config --stderr";
$results = shell_exec($command." 2>&1");
$bin_path = Library::retrieve('composer_bin_path');
$command = "$bin_path/phpunit --configuration $xml_config --stderr";
$results = shell_exec($command);

ini_set('html_errors', $html_errors);

$start = strpos($results, '{');
$end = strrpos($results, '}');
return substr($results, $start, $end - $start + 1);

return $results;
}
}

0 comments on commit 6789144

Please sign in to comment.