Skip to content

Fix integration test issue with interceptor #37187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 12, 2025
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2015 Adobe
* All Rights Reserved.
*/
namespace Magento\TestFramework\Store;

use Magento\Framework\Interception\InterceptorInterface;
use Magento\TestFramework\App\Config;
use Magento\TestFramework\ObjectManager;

/**
* Integration tests decoration of store manager
*
* @package Magento\TestFramework\Store
*/
class StoreManager implements \Magento\Store\Model\StoreManagerInterface
{
Expand Down Expand Up @@ -43,7 +42,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function setCurrentStore($store)
{
Expand All @@ -52,7 +51,7 @@ public function setCurrentStore($store)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function setIsSingleStoreModeAllowed($value)
{
Expand All @@ -61,7 +60,7 @@ public function setIsSingleStoreModeAllowed($value)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function hasSingleStore()
{
Expand All @@ -71,7 +70,7 @@ public function hasSingleStore()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function isSingleStoreMode()
{
Expand All @@ -81,7 +80,7 @@ public function isSingleStoreMode()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getStore($storeId = null)
{
Expand All @@ -91,7 +90,7 @@ public function getStore($storeId = null)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getStores($withDefault = false, $codeKey = false)
{
Expand All @@ -101,7 +100,7 @@ public function getStores($withDefault = false, $codeKey = false)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getWebsite($websiteId = null)
{
Expand All @@ -111,7 +110,7 @@ public function getWebsite($websiteId = null)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getWebsites($withDefault = false, $codeKey = false)
{
Expand All @@ -121,13 +120,16 @@ public function getWebsites($withDefault = false, $codeKey = false)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function reinitStores()
{
//In order to restore configFixture values
$testAppConfig = ObjectManager::getInstance()->get(Config::class);
$reflection = new \ReflectionClass($testAppConfig);
if ($reflection->implementsInterface(InterceptorInterface::class)) {
$reflection = $reflection->getParentClass();
}
$dataProperty = $reflection->getProperty('data');
$dataProperty->setAccessible(true);
$savedConfig = $dataProperty->getValue($testAppConfig);
Expand All @@ -139,7 +141,7 @@ public function reinitStores()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getDefaultStoreView()
{
Expand All @@ -149,7 +151,7 @@ public function getDefaultStoreView()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getGroup($groupId = null)
{
Expand All @@ -159,7 +161,7 @@ public function getGroup($groupId = null)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getGroups($withDefault = false)
{
Expand Down