From 0d0f0cf9f4dfd41e62f9eba912018cf51751d020 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Wed, 16 Oct 2024 09:28:37 +0200 Subject: [PATCH] [TASK] Adapt GravatarProviderTest for v13 --- .../AvatarProvider/GravatarProviderTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Tests/Functional/AvatarProvider/GravatarProviderTest.php b/Tests/Functional/AvatarProvider/GravatarProviderTest.php index 56588e3a..5963dffc 100644 --- a/Tests/Functional/AvatarProvider/GravatarProviderTest.php +++ b/Tests/Functional/AvatarProvider/GravatarProviderTest.php @@ -12,6 +12,11 @@ use T3G\AgencyPack\Blog\AvatarProvider\GravatarProvider; use T3G\AgencyPack\Blog\Domain\Model\Author; +use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; +use TYPO3\CMS\Core\Http\ServerRequest; +use TYPO3\CMS\Core\TypoScript\AST\Node\RootNode; +use TYPO3\CMS\Core\TypoScript\FrontendTypoScript; +use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; class GravatarProviderTest extends FunctionalTestCase @@ -26,6 +31,13 @@ class GravatarProviderTest extends FunctionalTestCase public function testGetAvatarUrlReturnsOriginalGravatarComUrl(): void { + $frontendTypoScript = new FrontendTypoScript(new RootNode(), [], [], []); + $frontendTypoScript->setSetupArray([]); + $request = (new ServerRequest()) + ->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE) + ->withAttribute('frontend.typoscript', $frontendTypoScript); + $this->get(ConfigurationManagerInterface::class)->setRequest($request); + $author = (new Author())->setEmail('name@host.tld'); $gravatarProvider = new GravatarProvider(); self::assertSame( @@ -37,6 +49,12 @@ public function testGetAvatarUrlReturnsOriginalGravatarComUrl(): void public function testGetAvatarUrlReturnsTypo3TempUrl(): void { $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['blog']['enableGravatarProxy'] = '1'; + $frontendTypoScript = new FrontendTypoScript(new RootNode(), [], [], []); + $frontendTypoScript->setSetupArray([]); + $request = (new ServerRequest()) + ->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE) + ->withAttribute('frontend.typoscript', $frontendTypoScript); + $this->get(ConfigurationManagerInterface::class)->setRequest($request); $author = (new Author())->setEmail('name@host.tld'); $gravatarProvider = new GravatarProvider();