Skip to content

Commit

Permalink
OXDEV-7248 Update container parameter mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
AshrafOxid committed May 29, 2024
1 parent 4b27fdc commit c6c5baf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 7 additions & 1 deletion tests/Integration/TestingFixturesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit c6c5baf

Please sign in to comment.