Skip to content

[2.x] fix(testing): reorder boot sequence in OverrideExtensionManagerForTests#4719

Draft
DavideIadeluca wants to merge 4 commits into
flarum:2.xfrom
glowingblue:di/testing-fix
Draft

[2.x] fix(testing): reorder boot sequence in OverrideExtensionManagerForTests#4719
DavideIadeluca wants to merge 4 commits into
flarum:2.xfrom
glowingblue:di/testing-fix

Conversation

@DavideIadeluca

@DavideIadeluca DavideIadeluca commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #4600
Reorder the boot sequence in OverrideExtensionManagerForTests to fix locale translations never loading in integration tests as described in #4600. LocaleManager was being resolved during onEnable() before extend() had registered the locale resolving() callbacks. This fix runs extend() first (with booted=true), then the enable() loop (with booted=false so migrations still run).

Changes proposed in this pull request:

Reviewers should focus on:

  • Whether the booted toggle could cause side effects which the testing suite of the framework itself doesn't catch

Screenshot

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

Required changes:

  • Related documentation PR: (Remove if irrelevant)

Previously $extensionManager->booted was not recognized because the ExtensionManager itself doesn't have this property whereas `ExtensionManagerIncludeCurrent` has it
@DavideIadeluca DavideIadeluca changed the title [2.x] fix(testing): change order of $extensionManager->booted = true; [2.x] fix(testing): change lifecycle ordering in testing ExtensionManager Jun 12, 2026
@DavideIadeluca DavideIadeluca changed the title [2.x] fix(testing): change lifecycle ordering in testing ExtensionManager [2.x] fix(testing): change ifecycle ordering in OverrideExtensionManagerForTests Jun 12, 2026
@DavideIadeluca DavideIadeluca changed the title [2.x] fix(testing): change ifecycle ordering in OverrideExtensionManagerForTests [2.x] fix(testing): reorder boot sequence in OverrideExtensionManagerForTests Jun 12, 2026
@DavideIadeluca DavideIadeluca marked this pull request as ready for review June 12, 2026 20:22
@DavideIadeluca DavideIadeluca requested a review from a team as a code owner June 12, 2026 20:22
@DavideIadeluca DavideIadeluca marked this pull request as draft June 13, 2026 18:19
@DavideIadeluca DavideIadeluca marked this pull request as ready for review June 13, 2026 18:30
@DavideIadeluca DavideIadeluca changed the title [2.x] fix(testing): reorder boot sequence in OverrideExtensionManagerForTests [?] fix(testing): reorder boot sequence in OverrideExtensionManagerForTests Jun 15, 2026
@DavideIadeluca DavideIadeluca marked this pull request as draft June 15, 2026 07:56
@DavideIadeluca DavideIadeluca changed the title [?] fix(testing): reorder boot sequence in OverrideExtensionManagerForTests [2.x] fix(testing): reorder boot sequence in OverrideExtensionManagerForTests Jun 15, 2026
@DavideIadeluca

Copy link
Copy Markdown
Contributor Author

Let's revisit this after 2.0 stable has been released. Fixing #4600 is technically a breaking change in the testing suite as e.g. 2nd or 3rd party vendors might already have assertions in place which assume that language packs are not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend\Locales translations never register in integration tests (1.x + 2.x)

1 participant