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

CRM-20455 - Allow CRM_Core_DAOTest to pass w/packages#259 #14883

Merged
merged 2 commits into from
Jul 25, 2019

Conversation

totten
Copy link
Member

@totten totten commented Jul 25, 2019

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:

  1. A function signature needs changing.
  2. CiviUnitTestCase::setUp() effectively calls Civi\Core\Container::boot() multiple times (once via Civi::reset() and then via CRM_Core_Config::singleton()), which initializes various services twice in a row. This creates a mismatch in the lifecycle of Civi::$statics and dispatcher (such that Civi::$statics may retain a stale copy of dispatcher).

After

CRM_Core_DAOTest passes with either current code or with packages#259

Comments

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 in CiviUnitTestCase::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.

@civibot
Copy link

civibot bot commented Jul 25, 2019

(Standard links)

@civibot civibot bot added the master label Jul 25, 2019
@totten totten changed the title (WIP) CRM-20455 - Allow CRM_Core_DAOTest w/packages#259 CRM-20455 - Allow CRM_Core_DAOTest to pass w/packages#259 Jul 25, 2019
This patch is going in as part of some cleanup/refactoring in a mid-cycle
change. Using the docblock allows the type to be communicated without
breaking on mid-cycle contract change.
@eileenmcnaughton eileenmcnaughton merged commit 46a70e3 into civicrm:master Jul 25, 2019
@totten totten deleted the master-daotest branch July 26, 2019 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants