diff --git a/CHANGELOG.md b/CHANGELOG.md index e15b71c..7245fd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). - Stop using Prophecy (#676) ### Fixed +- Get the functional tests to work with TYPO3 >= 12.1 (#704) - Avoid race condition on case-insensitive filesystems (#657) ## 3.0.0 diff --git a/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php b/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php index 49fd285..47b4582 100644 --- a/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php +++ b/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php @@ -6,6 +6,8 @@ namespace TTN\Tea\Tests\Functional\Domain\Repository\Product; use TTN\Tea\Domain\Model\Product\Tea; use TTN\Tea\Domain\Repository\Product\TeaRepository; +use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; +use TYPO3\CMS\Core\Http\ServerRequest; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Domain\Model\FileReference; use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager; @@ -27,6 +29,11 @@ class TeaRepositoryTest extends FunctionalTestCase { parent::setUp(); + // This is needed to make the functional tests work with TYPO3 12.1. We might be able to remove this in the + // once we've updated to TYPO3 12.1.3 or 12.2. + $request = (new ServerRequest())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_CLI); + $GLOBALS['TYPO3_REQUEST'] = $request; + $this->persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); $this->subject = $this->getContainer()->get(TeaRepository::class);