Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(NFC) CiviUnitTestCase - Fix edge-case for mis-reported error #12347

Merged
merged 1 commit into from
Jun 21, 2018

Conversation

totten
Copy link
Member

@totten totten commented Jun 21, 2018

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 error(s).

This fixes the reporting of the error.

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.

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.
@civibot
Copy link

civibot bot commented Jun 21, 2018

(Standard links)

@totten totten changed the title CiviUnitTestCase - Fix edge-case for mis-reported error (NFC) CiviUnitTestCase - Fix edge-case for mis-reported error Jun 21, 2018
@totten
Copy link
Member Author

totten commented Jun 21, 2018

I'm biased, but I'd argue this is NFC because the change doesn't affect runtime behavior, and it doesn't change test-semantics. It tweaks the test framework.

@seamuslee001
Copy link
Contributor

giving this merge on pass as agree with the change

@eileenmcnaughton eileenmcnaughton merged commit f0fa060 into civicrm:master Jun 21, 2018
@totten totten deleted the master-hook-reset branch June 21, 2018 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants