-
-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extensions - Reset container+dispatcher after toggling extensions
This fixes an issue in E2E testing. Suppose you have a test like this: 1: function testFoo() { 2: civicrm_api3('Extension', 'enable', ['key' => 'foo']); 3: assertTrue(Civi::container()->has('foo_service')); 4: civicrm_api3('Extension', 'disable', ['key' => 'foo']); 5: assertFalse(Civi::container()->has('foo_service')); 6: } The assertion at line 5 would fail -- because the 'disable' step did not fully reset the `Container`. This problem could then apply to anything that lives in the container, such as the dispatcher and its listeners. There is test-coverage in `mixin/scan-classes@1/example` and `E2E_Shimmy_LifecycleTest::testLifecycleWithLocalFunctions()`. The test doesn't specifically mention `Container`, but it focuses on one important service (*the dispatcher*) that lives in the container. I'm not sure if the problem affected headless tests.
- Loading branch information
Showing
2 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters