From ac601c754d343b426e8e0e43fb31c0cf3b858ec6 Mon Sep 17 00:00:00 2001
From: Nikita Hovratov <nikita.h@live.de>
Date: Fri, 11 Nov 2022 20:22:44 +0100
Subject: [PATCH] [TASK] Replace prophecy in EXT:core SiteConfigurationTest

Resolves: #98750
Releases: main
Change-Id: I3d57299abd943eca8f2e12a3ad56461e7339c28f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76563
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../Configuration/SiteConfigurationTest.php   | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/typo3/sysext/core/Tests/Unit/Configuration/SiteConfigurationTest.php b/typo3/sysext/core/Tests/Unit/Configuration/SiteConfigurationTest.php
index e390e765556a..ab096af75bc2 100644
--- a/typo3/sysext/core/Tests/Unit/Configuration/SiteConfigurationTest.php
+++ b/typo3/sysext/core/Tests/Unit/Configuration/SiteConfigurationTest.php
@@ -17,22 +17,18 @@ declare(strict_types=1);
 
 namespace TYPO3\CMS\Core\Tests\Unit\Configuration;
 
-use Prophecy\Argument;
-use Prophecy\PhpUnit\ProphecyTrait;
-use Psr\EventDispatcher\EventDispatcherInterface;
 use Symfony\Component\Yaml\Yaml;
-use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend;
+use TYPO3\CMS\Core\Cache\Frontend\NullFrontend;
 use TYPO3\CMS\Core\Configuration\Loader\YamlFileLoader;
 use TYPO3\CMS\Core\Configuration\SiteConfiguration;
 use TYPO3\CMS\Core\Core\Environment;
 use TYPO3\CMS\Core\Http\Uri;
+use TYPO3\CMS\Core\Tests\Unit\Fixtures\EventDispatcher\NoopEventDispatcher;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
 class SiteConfigurationTest extends UnitTestCase
 {
-    use ProphecyTrait;
-
     protected bool $resetSingletonInstances = true;
 
     protected ?SiteConfiguration $siteConfiguration;
@@ -52,17 +48,10 @@ class SiteConfigurationTest extends UnitTestCase
             GeneralUtility::mkdir_deep($this->fixturePath);
         }
         $this->testFilesToDelete[] = $basePath;
-        $coreCacheProphecy = $this->prophesize(PhpFrontend::class);
-        $coreCacheProphecy->require(Argument::any())->willReturn(false);
-        $coreCacheProphecy->set(Argument::any(), Argument::any())->willReturn(null);
-        $coreCacheProphecy->remove(Argument::any(), Argument::any())->willReturn(null);
-        $eventDispatcher = $this->prophesize(EventDispatcherInterface::class);
-        $eventDispatcher->dispatch(Argument::cetera())->willReturnArgument(0);
-
         $this->siteConfiguration = new SiteConfiguration(
             $this->fixturePath,
-            $eventDispatcher->reveal(),
-            $coreCacheProphecy->reveal()
+            new NoopEventDispatcher(),
+            new NullFrontend('test')
         );
     }
 
-- 
GitLab