better formatting
This commit is contained in:
parent
b6ad89e0f3
commit
6bd6de7676
@ -5,23 +5,29 @@ use \JHodges\GiteaBot\Client;
|
|||||||
|
|
||||||
final class Poster{
|
final class Poster{
|
||||||
|
|
||||||
function __construct($testdox,$xml){
|
function __construct($testdox_path,$xml_path){
|
||||||
$report=file_get_contents($testdox);
|
$testdox=file_get_contents($testdox_path);
|
||||||
$report=preg_replace('# \[#',' * [',$report);
|
$testdox=preg_replace('# \[#',' * [',$testdox);
|
||||||
|
|
||||||
$xml = simplexml_load_file($xml);
|
|
||||||
|
$xml = simplexml_load_file($xml_path);
|
||||||
$project = $xml->testsuite;
|
$project = $xml->testsuite;
|
||||||
//echo sprintf("total: %s msec", ($project['time'])) . PHP_EOL;
|
$summary='';//sprintf("total: %s sec", ($project['time'])) . PHP_EOL;
|
||||||
|
$report='';
|
||||||
|
foreach($project->attributes() as $k=>$v){
|
||||||
|
//print_r($k);print_r($v);die();
|
||||||
|
$summary.=" * $k : {$v[0]}\n";
|
||||||
|
}
|
||||||
foreach ($project->testsuite as $testsuite) {
|
foreach ($project->testsuite as $testsuite) {
|
||||||
//echo sprintf(" suite: %s msec : %s", ($testsuite['time']), $testsuite['name']) . PHP_EOL;
|
//$summary.=sprintf(" suite: %s sec : %s", ($testsuite['time']), $testsuite['name']) . PHP_EOL;
|
||||||
foreach ($testsuite->testcase as $testcase) {
|
foreach ($testsuite->testcase as $testcase) {
|
||||||
//echo sprintf(" case: %s msec : %s", ($testcase['time']), $testcase['name']) . PHP_EOL;
|
//$summary.=sprintf(" case: %s sec : %s", ($testcase['time']), $testcase['name']) . PHP_EOL;
|
||||||
foreach($testcase as $k=>$v){
|
foreach($testcase as $k=>$v){
|
||||||
$report.="\n```plain\n".print_r($testcase,true)."\n```";
|
$report.="\n```plain\n".print_r($testcase,true)."\n```";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->report=$report;
|
$this->report=$summary."\n".$testdox.$report;
|
||||||
}
|
}
|
||||||
|
|
||||||
function post($url, $user, $pass, $repoUser, $repo){
|
function post($url, $user, $pass, $repoUser, $repo){
|
||||||
|
Loading…
Reference in New Issue
Block a user