CRM-20455 - Allow CRM_Core_DAOTest to pass w/packages#259 #14883
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This is a supplement to CRM-20455 and esp civicrm/civicrm-packages#259.
Before
CRM_Core_DAOTest
passes with current code, but it fails with packages#259 because:CiviUnitTestCase::setUp()
effectively callsCivi\Core\Container::boot()
multiple times (once viaCivi::reset()
and then viaCRM_Core_Config::singleton()
), which initializes various services twice in a row. This creates a mismatch in the lifecycle ofCivi::$statics
anddispatcher
(such thatCivi::$statics
may retain a stale copy ofdispatcher
).After
CRM_Core_DAOTest
passes with either current code or with packages#259Comments
For sub-item
#1
, the changed tests/functions are new; the signature change occurs mid-dev-cycle.For sub-item
#2
, any change to initialization inCiviUnitTestCase::setUp()
makes me nervous on account of the code's centrality. But fortunately, the reinitialization still runs at the same time (just non-duplicatively), and the test-suite shows a green light.