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

[TASK] Make functional tests executable for both core versions #412

Merged
merged 7 commits into from
Dec 19, 2024

Conversation

sbuerk
Copy link
Contributor

@sbuerk sbuerk commented Dec 19, 2024

  • [TASK] Add typo3/cms-install as $coreExtensionToLoad
    Since TYPO3 v13 the typo3/cms-install extension is optional
    and typo3/testing-framework no longer defines it as extension
    to load (core) in functional tests.

    web-vision/deepltranslate-core requires it for now to ensure
    that upgrade wizards can be executed - an oversight from TYPO3
    core team.

  • [TASK] Add dual TYPO3 version support for SiteBasedTestTrait
    The SiteBasedTestTrait takes care to write site configuration
    in functional tests and TYPO3 v13 changed the logic of writing
    it. Due to changed structure and the additional SiteSettings
    support functional tests failing now with TYPO3 v13.

    This change adopts required changed for the SiteBasedTestTrait
    while keeping TYPO3 v12 support intact.

  • [TASK] Use suitable siteconfig writer class in FormalityUpgradeWizard
    This change ensures to use the suiting site configuration writer
    class depending on the TYYPO3 version which has changed between
    TYPO3 v12 and v13.

  • [TASK] Avoid removed Bootstrap::initializeLanguageObject() call
    The Bootstrap::initializeLanguageObject() has been removed in
    TYPO3 v13 and is now replaced to ensure working test over all
    supported TYPO3 core versions.

  • [TASK] Mitigate removed TSFE->getContext() method in RenderTranslatedFlagInFrontendPreviewMode
    TYPO3 removed quite some method of TSFE internal or removed them,
    one of them getContext() can be mitigated easily.

    This change retrieves the context either from TSFE or uses the
    GeneralUtility::makeInstance() to retrieve it within the
    RenderTranslatedFlagInFrontendPreviewMode PSR-14 event listener.

  • [TASK] Mitigate deprecated fluid TemplateView in favour of ViewFactoryInterface
    Since TYPO3 v13 directly instantiating a concrete view has been
    replaced with a more generic ViewFactoryInterface along with
    default fluid template based variant.

    To keep functional tests hard as possible we need to work around
    the deprecation with TYPO3 v13 by using a version check in the
    ViewHelper related functional tests to use either the factory or
    the old way for dual TYPO3 version compatibility.

    [1] https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.3/Feature-104773-GenericViewFactory.html

  • [TASK] Add TYPO3 v13 code phpstan errors for TYPO3v12 to baseline
    PHPStan does not understand or respect TYPO3
    version conditional based code to make code
    flows based on the TYPO3 version, which leads
    to false-positive error reportings.

    Until a better solution can be provided, we need
    to add them to the depending phpstan baseline file.

    Used command(s):

    Build/Scripts/runTests.sh -t 12 -p 8.2 -s composerUpdate
    Build/Scripts/runTests.sh -t 12 -p 8.2 -s phpstanGenerateBaseline
    Build/Scripts/runTests.sh -t 13 -p 8.2 -s composerUpdate
    Build/Scripts/runTests.sh -t 13 -p 8.2 -s phpstanGenerateBaseline

@sbuerk sbuerk force-pushed the functional-tests branch 2 times, most recently from 187daac to 2513b34 Compare December 19, 2024 16:10
Since TYPO3 v13 the `typo3/cms-install` extension is optional
and typo3/testing-framework no longer defines it as extension
to load (core) in functional tests.

`web-vision/deepltranslate-core` requires it for now to ensure
that upgrade wizards can be executed - an oversight from TYPO3
core team.
The `SiteBasedTestTrait` takes care to write site configuration
in functional tests and TYPO3 v13 changed the logic of writing
it. Due to changed structure and the additional SiteSettings
support functional tests failing now with TYPO3 v13.

This change adopts required changed for the SiteBasedTestTrait
while keeping TYPO3 v12 support intact.
This change ensures to use the suiting site configuration writer
class depending on the TYYPO3 version which has changed between
TYPO3 v12 and v13.
The `Bootstrap::initializeLanguageObject()` has been removed in
TYPO3 v13 and is now replaced to ensure working test over all
supported TYPO3 core versions.
…tedFlagInFrontendPreviewMode`

TYPO3 removed quite some method of `TSFE` internal or removed them,
one of them `getContext()` can be mitigated easily.

This change retrieves the context either from TSFE or uses the
`GeneralUtility::makeInstance()` to retrieve it within the
`RenderTranslatedFlagInFrontendPreviewMode` PSR-14 event listener.
…yInterface

Since TYPO3 v13 directly instantiating a concrete view has been
replaced with a more generic `ViewFactoryInterface` along with
default fluid template based variant.

To keep functional tests hard as possible we need to work around
the deprecation with TYPO3 v13 by using a version check in the
ViewHelper related functional tests to use either the factory or
the old way for dual TYPO3 version compatibility.

[1] https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.3/Feature-104773-GenericViewFactory.html
PHPStan does not understand or respect TYPO3
version conditional based code to make code
flows based on the TYPO3 version, which leads
to false-positive error reportings.

Until a better solution can be provided, we need
to add them to the depending phpstan baseline file.

Used command(s):

```bash
Build/Scripts/runTests.sh -t 12 -p 8.2 -s composerUpdate
Build/Scripts/runTests.sh -t 12 -p 8.2 -s phpstanGenerateBaseline
Build/Scripts/runTests.sh -t 13 -p 8.2 -s composerUpdate
Build/Scripts/runTests.sh -t 13 -p 8.2 -s phpstanGenerateBaseline
```
@sbuerk sbuerk merged commit 75109d3 into main Dec 19, 2024
8 checks passed
@sbuerk sbuerk deleted the functional-tests branch December 19, 2024 17:00
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.

2 participants