From c6c5bafbd60e90e6468b90c2abfb9677f0e33f9d Mon Sep 17 00:00:00 2001 From: ashraf Date: Tue, 14 May 2024 09:13:04 +0200 Subject: [PATCH] OXDEV-7248 Update container parameter mocking --- tests/Integration/TestingFixturesTrait.php | 8 +++++++- .../ControllerRender/ModuleControllerRenderTest.php | 6 ------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/Integration/TestingFixturesTrait.php b/tests/Integration/TestingFixturesTrait.php index f975648..5c6ae95 100644 --- a/tests/Integration/TestingFixturesTrait.php +++ b/tests/Integration/TestingFixturesTrait.php @@ -14,9 +14,12 @@ use OxidEsales\EshopCommunity\Internal\Framework\Module\Install\Service\ModuleInstallerInterface; use OxidEsales\EshopCommunity\Internal\Framework\Module\Setup\Bridge\ModuleActivationBridgeInterface; use OxidEsales\EshopCommunity\Internal\Transition\Utility\BasicContextInterface; +use OxidEsales\EshopCommunity\Tests\ContainerTrait; trait TestingFixturesTrait { + use ContainerTrait; + private string $fixtureRoot = __DIR__; public function initFixtures(string $fixtureRoot): void @@ -45,7 +48,10 @@ public function deactivateModuleFixture(string $moduleId): void public function setShopSourceFixture(): void { - Registry::getConfig()->setConfigParam('sShopDir', "{$this->getFixturesDirectory()}/shop/source/"); + $this->createContainer(); + $this->container->setParameter('oxid_shop_source_directory', "{$this->getFixturesDirectory()}/shop/source/"); + $this->compileContainer(); + $this->attachContainerToContainerFactory(); } public function setThemeFixture(string $themeId): void diff --git a/tests/Integration/TwigEngine/ControllerRender/ModuleControllerRenderTest.php b/tests/Integration/TwigEngine/ControllerRender/ModuleControllerRenderTest.php index b668381..7ad90f1 100644 --- a/tests/Integration/TwigEngine/ControllerRender/ModuleControllerRenderTest.php +++ b/tests/Integration/TwigEngine/ControllerRender/ModuleControllerRenderTest.php @@ -13,14 +13,12 @@ use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\ShopControl; use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory; -use OxidEsales\EshopCommunity\Internal\Transition\Utility\ContextInterface; use OxidEsales\Twig\Tests\Integration\TestingFixturesTrait; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; use Psr\Log\LoggerInterface; -/** @runTestsInSeparateProcesses */ final class ModuleControllerRenderTest extends TestCase { use TestingFixturesTrait; @@ -118,10 +116,6 @@ private function stubRequestData(): void private function switchDebugMode(bool $enable): void { $configFile = $this->prophesize(ConfigFile::class); - $configFile->getVar('sCompileDir') - ->willReturn( - $this->get(ContextInterface::class)->getCacheDirectory() - ); $configFile->getVar('iDebug')->willReturn($enable); Registry::set(ConfigFile::class, $configFile->reveal()); }