From afc4c618f4251ae1acf34aa57804c43a472c3023 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 10 Feb 2020 18:01:10 +0000 Subject: [PATCH] fail count --- src/Poster.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Poster.php b/src/Poster.php index e028243..c3fa2c0 100644 --- a/src/Poster.php +++ b/src/Poster.php @@ -7,7 +7,7 @@ final class Poster{ private $report; private $level=0; - private $total_fail=0; + private $failCount=0; function __construct($xml_path){ $this->xml = simplexml_load_file($xml_path); @@ -23,13 +23,17 @@ final class Poster{ // create the issue if(trim($this->report)){ $issue=$this->repo->createIssue([ - 'title'=>"$title ({$this->total_fail} fail)", + 'title'=>"$title ({$this->failCount} fail)", 'body'=>$this->report ]); } } + public function getFailCount(){ + return $this->failCount; + } + private function process($item){ $this->level++; if(isset($item->testcase)){ @@ -41,7 +45,7 @@ final class Poster{ if(trim($v)) $failmsg.="```plain\n$v\n```\n"; } if($failmsg){ - $this->total_fail++; + $this->failCount++; $this->report.=" * [ ] {$att->name[0]} $failmsg\n"; }else{ $this->report.=" * [x] {$att->name[0]}\n";