Skip to content

Commit 4e46722

Browse files
author
Joan He
committed
Merge remote-tracking branch 'origin/MAGETWO-33873-Store-Constant' into develop
2 parents d511960 + c033911 commit 4e46722

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

app/code/Magento/Store/App/Action/Plugin/Context.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Store\App\Action\Plugin;
88

99
use Magento\Framework\App\Http\Context as HttpContext;
10+
use Magento\Store\Model\StoreManagerInterface;
1011

1112
/**
1213
* Class ContextPlugin
@@ -71,7 +72,7 @@ public function aroundDispatch(
7172
);
7273

7374
$this->httpContext->setValue(
74-
HttpContext::CONTEXT_STORE,
75+
StoreManagerInterface::CONTEXT_STORE,
7576
$this->httpRequest->getParam(
7677
'___store',
7778
$defaultStore->getStoreCodeFromCookie()

app/code/Magento/Store/Model/StoreManagerInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
interface StoreManagerInterface
1010
{
11+
/**
12+
* Store cache context
13+
*/
14+
const CONTEXT_STORE = 'store';
15+
1116
/**
1217
* Allow or disallow single store mode
1318
*

dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@
682682
['CONTEXT_AUTH', 'Magento\Customer\Helper\Data', 'Magento\Customer\Model\Context::CONTEXT_AUTH'],
683683
['CONTEXT_CURRENCY', 'Magento\Customer\Helper\Data', 'Magento\Framework\App\Http\Context::CONTEXT_CURRENCY'],
684684
['CONTEXT_GROUP', 'Magento\Customer\Helper\Data', 'Magento\Customer\Model\Context::CONTEXT_GROUP'],
685-
['CONTEXT_STORE', 'Magento\Customer\Helper\Data', 'Magento\Framework\App\Http\Context::CONTEXT_STORE'],
685+
['CONTEXT_STORE', 'Magento\Customer\Helper\Data', 'Magento\Store\Model\StoreManagerInterface::CONTEXT_STORE'],
686686
['DEBUG_CONNECT', 'Magento\Framework\DB\Adapter\Pdo\Mysql', 'Magento\Framework\DB\LoggerInterface::TYPE_CONNECT'],
687687
['DEBUG_TRANSACTION', 'Magento\Framework\DB\Adapter\Pdo\Mysql', 'Magento\Framework\DB\LoggerInterface::TYPE_TRANSACTION'],
688688
['DEBUG_QUERY', 'Magento\Framework\DB\Adapter\Pdo\Mysql', 'Magento\Framework\DB\LoggerInterface::TYPE_QUERY'],

dev/tests/unit/testsuite/Magento/Store/App/Action/Plugin/ContextTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace Magento\Store\App\Action\Plugin;
1010
use Magento\Framework\App\Http\Context;
11+
use Magento\Store\Model\StoreManagerInterface;
1112

1213
/**
1314
* Class ContextPluginTest
@@ -133,7 +134,7 @@ public function testAroundDispatch()
133134
->method('setValue')
134135
->will($this->returnValueMap([
135136
[Context::CONTEXT_CURRENCY, 'UAH', 'UAH', $this->httpContextMock],
136-
[Context::CONTEXT_STORE, 'default', 'default', $this->httpContextMock],
137+
[StoreManagerInterface::CONTEXT_STORE, 'default', 'default', $this->httpContextMock],
137138
]));
138139
$this->assertEquals(
139140
'ExpectedValue',

lib/internal/Magento/Framework/App/Http/Context.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ class Context
1414
* Currency cache context
1515
*/
1616
const CONTEXT_CURRENCY = 'current_currency';
17-
/**
18-
* Store cache context
19-
*/
20-
const CONTEXT_STORE = 'store';
2117

2218
/**
2319
* Data storage

0 commit comments

Comments
 (0)