From 2e90bf37dcf8438a6080b434518acf1bf514ec90 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 14 Nov 2014 17:47:34 -0800 Subject: [PATCH] CRM-15578, CRM-13523 - CiviUnitTestCase - Improve output for PEAR DB errors --- tests/phpunit/CiviTest/CiviUnitTestCase.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 749301f540..ae0ab826ff 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -161,6 +161,15 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { } } + protected function runTest() { + try { + return parent::runTest(); + } catch (PEAR_Exception $e) { + // PEAR_Exception has metadata in funny places, and PHPUnit won't log it nicely + throw new Exception(\CRM_Core_Error::formatTextException($e), $e->getCode()); + } + } + /** * @return bool */ -- 2.25.1