diff --git a/app/code/Magento/Store/App/Action/Plugin/Context.php b/app/code/Magento/Store/App/Action/Plugin/Context.php index b418c7b2118df..4fc829525dd22 100644 --- a/app/code/Magento/Store/App/Action/Plugin/Context.php +++ b/app/code/Magento/Store/App/Action/Plugin/Context.php @@ -7,6 +7,7 @@ namespace Magento\Store\App\Action\Plugin; use Magento\Framework\App\Http\Context as HttpContext; +use Magento\Store\Model\StoreManagerInterface; /** * Class ContextPlugin @@ -71,7 +72,7 @@ public function aroundDispatch( ); $this->httpContext->setValue( - HttpContext::CONTEXT_STORE, + StoreManagerInterface::CONTEXT_STORE, $this->httpRequest->getParam( '___store', $defaultStore->getStoreCodeFromCookie() diff --git a/app/code/Magento/Store/Model/StoreManagerInterface.php b/app/code/Magento/Store/Model/StoreManagerInterface.php index 8f570f4556f1d..68d9acb741a45 100644 --- a/app/code/Magento/Store/Model/StoreManagerInterface.php +++ b/app/code/Magento/Store/Model/StoreManagerInterface.php @@ -8,6 +8,11 @@ interface StoreManagerInterface { + /** + * Store cache context + */ + const CONTEXT_STORE = 'store'; + /** * Allow or disallow single store mode * diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php index 80acb1a7e464f..d90e3a34aa034 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php @@ -682,7 +682,7 @@ ['CONTEXT_AUTH', 'Magento\Customer\Helper\Data', 'Magento\Customer\Model\Context::CONTEXT_AUTH'], ['CONTEXT_CURRENCY', 'Magento\Customer\Helper\Data', 'Magento\Framework\App\Http\Context::CONTEXT_CURRENCY'], ['CONTEXT_GROUP', 'Magento\Customer\Helper\Data', 'Magento\Customer\Model\Context::CONTEXT_GROUP'], - ['CONTEXT_STORE', 'Magento\Customer\Helper\Data', 'Magento\Framework\App\Http\Context::CONTEXT_STORE'], + ['CONTEXT_STORE', 'Magento\Customer\Helper\Data', 'Magento\Store\Model\StoreManagerInterface::CONTEXT_STORE'], ['DEBUG_CONNECT', 'Magento\Framework\DB\Adapter\Pdo\Mysql', 'Magento\Framework\DB\LoggerInterface::TYPE_CONNECT'], ['DEBUG_TRANSACTION', 'Magento\Framework\DB\Adapter\Pdo\Mysql', 'Magento\Framework\DB\LoggerInterface::TYPE_TRANSACTION'], ['DEBUG_QUERY', 'Magento\Framework\DB\Adapter\Pdo\Mysql', 'Magento\Framework\DB\LoggerInterface::TYPE_QUERY'], diff --git a/dev/tests/unit/testsuite/Magento/Store/App/Action/Plugin/ContextTest.php b/dev/tests/unit/testsuite/Magento/Store/App/Action/Plugin/ContextTest.php index 0dade287401d1..83a9c90a9530a 100644 --- a/dev/tests/unit/testsuite/Magento/Store/App/Action/Plugin/ContextTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/App/Action/Plugin/ContextTest.php @@ -8,6 +8,7 @@ namespace Magento\Store\App\Action\Plugin; use Magento\Framework\App\Http\Context; +use Magento\Store\Model\StoreManagerInterface; /** * Class ContextPluginTest @@ -133,7 +134,7 @@ public function testAroundDispatch() ->method('setValue') ->will($this->returnValueMap([ [Context::CONTEXT_CURRENCY, 'UAH', 'UAH', $this->httpContextMock], - [Context::CONTEXT_STORE, 'default', 'default', $this->httpContextMock], + [StoreManagerInterface::CONTEXT_STORE, 'default', 'default', $this->httpContextMock], ])); $this->assertEquals( 'ExpectedValue', diff --git a/lib/internal/Magento/Framework/App/Http/Context.php b/lib/internal/Magento/Framework/App/Http/Context.php index 0cd9401ff2c34..5af126ef40d15 100644 --- a/lib/internal/Magento/Framework/App/Http/Context.php +++ b/lib/internal/Magento/Framework/App/Http/Context.php @@ -14,10 +14,6 @@ class Context * Currency cache context */ const CONTEXT_CURRENCY = 'current_currency'; - /** - * Store cache context - */ - const CONTEXT_STORE = 'store'; /** * Data storage