From f40f88a0f3802ccf8c07ab698591c972fbea206e Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 7 May 2014 10:20:21 +0100 Subject: [PATCH] Making phpunit plugin log the TAP string in the event it fails to process it. --- PHPCI/Plugin/PhpUnit.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/PHPCI/Plugin/PhpUnit.php b/PHPCI/Plugin/PhpUnit.php index 16de7aa0..327e41f3 100755 --- a/PHPCI/Plugin/PhpUnit.php +++ b/PHPCI/Plugin/PhpUnit.php @@ -132,9 +132,16 @@ class PhpUnit implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin $success &= $this->runDir($this->directory); } - $output = $this->phpci->getLastOutput(); - $tapParser = new TapParser($output); - $output = $tapParser->parse(); + $tapString = $this->phpci->getLastOutput(); + + try { + $tapParser = new TapParser($tapString); + $output = $tapParser->parse(); + } catch (\Exception $ex) { + $this->phpci->logFailure($tapString); + throw $ex; + } + $failures = $tapParser->getTotalFailures(); $this->build->storeMeta('phpunit-errors', $failures);