CRM_Core_TransactionTest - Improve reporting of unplanned exceptions
authorTim Otten <totten@civicrm.org>
Sat, 15 Nov 2014 00:03:09 +0000 (16:03 -0800)
committerTim Otten <totten@civicrm.org>
Sat, 15 Nov 2014 00:03:09 +0000 (16:03 -0800)
tests/phpunit/CRM/Core/TransactionTest.php

index 7ac5d1379a1734b55da648155a29e734c9781efb..0c58d73a8ada5de30f63a81e92f5d7f03561b5dd 100644 (file)
@@ -255,9 +255,11 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase {
       });
     } catch (Exception $ex) {
       $e = $ex;
+      if (get_class($e) != 'Exception' || $e->getMessage() != 'Ruh-roh') {
+        throw $e;
+      }
     }
     $this->assertTrue($e instanceof Exception);
-    $this->assertEquals('Ruh-roh', $e->getMessage());
     $this->assertContactsExistByOffset(array(0 => FALSE));
   }