test/phpunit/api/v3 - Fix spooky interaction
authorTim Otten <totten@civicrm.org>
Fri, 17 Mar 2023 03:51:34 +0000 (20:51 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 17 Mar 2023 04:02:11 +0000 (21:02 -0700)
commite314f51db2404d4d9f947f3c5a0103f3a88ba06e
treedd79edc89e3ede3bbb699ca101329417109c1013
parenta5fde0a07612ba20eefef35eff7e082f0df011f7
test/phpunit/api/v3 - Fix spooky interaction

This fixes an issue observed in review of 25673. With that patch included,
`JobProcessMailingTest` would still pass... but only in isolation. When
combined with `ExceptionTest`, it would fail.

I tried disabling the entire substance of `ExceptionTest`, and it still
failed. Say what?

The problem was _the order_ in which `ExceptionTest` does its initialization
(`parent::setUp()` and `$this->useTransaction()`). I suppose that order
determines the effectiveness of the transaction.

Most tests call `setup()` then `useTransaction()`. I looked for
outliers which flipped the order -- and found `EntityTagACLTest`
has the same init and the same spooky interaction.

After fixing the outliers, I'm getting the expected results on
`JobProcessMailingTest`.
tests/phpunit/api/v3/EntityTagACLTest.php
tests/phpunit/api/v3/ExceptionTest.php
tests/phpunit/api/v3/PaymentTokenTest.php
tests/phpunit/api/v3/SurveyTest.php