CiviUnitTestCase - Fix edge-case for mis-reported error
authorTim Otten <totten@civicrm.org>
Thu, 21 Jun 2018 01:16:32 +0000 (18:16 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 21 Jun 2018 01:16:32 +0000 (18:16 -0700)
commit36a29dc00163034d14b968bc285404a004bf2a3d
treee379273ad7ab77d15fdc7c6a79c38f46d5b8b8d4
parentb34b295a191e0a8bb1d65a9e4dc9cd8df84b0fcb
CiviUnitTestCase - Fix edge-case for mis-reported error

Suppose you run a test and it encounters an error very early in process --
e.g.  while processing `setUp()`, before constructing the instance of
`$this->hookClass`.  It then proceeds to `tearDown()`. Later, the test
runner will give you a report on the rrors.

Before
------------

The `tearDown` fails because the missing instance of `$this->hookClass`
raises another error, and test-report shows this misleading reference.

After
------------

The `tearDown` proceeds, and the test-report shows the real cause
of the failure.
tests/phpunit/CiviTest/CiviUnitTestCase.php