[BUGFIX] Respect composer mode only extension in FunctionalTestCase
#634
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.
The
typo3/testing-frameworkcreates functional test instancesas "classic" mode instances, writing a
PackageStates.phpfilecomposed using composer information, provided and handled by the
internal
ComposerPackageManagerclass. Extensions in the statefile are not sorted based on their dependencies and suggestions.
To mitigate this and having a correctly sorted extension state
file, the
PackageCollectionservice has been introduced withthe goal to resort the extension state file after the initial
write to provide the correct sorted extension state.
The extension sorting within the state file is important, as the
TYPO3 Core uses this sorting to loop over extensions to collect
information from the extensions, for example TCA, TCAOverrides,
ext_localconf.php and other things. Package sorting is here very
important to allow extensions to reconfigure or change the stuff
from other extensions, which is guaranteed in normal "composer"
and "classic" mode instances.
For "classic" mode instances, only the
ext_emconf.phpfile istaken into account and "composer.json" as the source of thruth
for "composer" mode instances since TYPO3 v12, which made the
ext_emconf.phpfile obsolete for extensions only installedwith composer.
Many agencies removed the optional
ext_emconf.phpfile forproject local path extensions like a sitepackage to remove
the maintenance burden, which is a valid case.
Sadly, the
PackageCollectionadopted from the TYPO3 CorePackageManagerdid not reflected this case and failed forextensions to properly sort only on extension dependencies
and keys due the mix of extension key and composer package
name handling. Extension depending on another extension
failed to be sorted correctly with following exception:
This change modifies the
PackageCollectionimplementationto take only TYPO3 extension and system extension into account
for dependency resolving and sorting, using
ext_emconf.phpdepends/suggest information as first source and falling back
to
composerrequire and suggestion information.Resolves: #541
Releases: main, 8