File tree Expand file tree Collapse file tree 2 files changed +49
-1
lines changed
app/code/Magento/Store/Model
dev/tests/integration/testsuite/Magento/Store/Model Expand file tree Collapse file tree 2 files changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ public function isSingleStoreMode()
152
152
public function getStore ($ storeId = null )
153
153
{
154
154
if (!isset ($ storeId ) || '' === $ storeId || $ storeId === true ) {
155
- if (! $ this ->currentStoreId ) {
155
+ if (null === $ this ->currentStoreId ) {
156
156
\Magento \Framework \Profiler::start ('store.resolve ' );
157
157
$ this ->currentStoreId = $ this ->storeResolver ->getCurrentStoreId ();
158
158
\Magento \Framework \Profiler::stop ('store.resolve ' );
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2016 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \Store \Model ;
7
+
8
+ use Magento \Framework \ObjectManagerInterface as ObjectManager ;
9
+ use Magento \Store \Model \Store ;
10
+ use Magento \Store \Model \StoreManagerInterface ;
11
+ use Magento \TestFramework \Helper \Bootstrap ;
12
+
13
+ class StoreManagerTest extends \PHPUnit_Framework_TestCase
14
+ {
15
+ /**
16
+ * @var StoreManagerInterface
17
+ */
18
+ private $ storeManager ;
19
+
20
+ /**
21
+ * @var ObjectManager
22
+ */
23
+ private $ objectManager ;
24
+
25
+ /**
26
+ * Class dependencies initialization
27
+ *
28
+ * @return void
29
+ */
30
+ protected function setUp ()
31
+ {
32
+ $ this ->objectManager = Bootstrap::getObjectManager ();
33
+ $ this ->storeManager = $ this ->objectManager ->get (StoreManagerInterface::class);
34
+ }
35
+
36
+ /**
37
+ * Check that behavior of setting and getting store into StoreManager is correct
38
+ * Setting: Magento\Store\Model\StoreManagerInterface::setCurrentStore
39
+ * Getting: Magento\Store\Model\StoreManagerInterface::getStore
40
+ *
41
+ * @return void
42
+ */
43
+ public function testDefaultStoreIdIsSetCorrectly ()
44
+ {
45
+ $ this ->storeManager ->setCurrentStore (Store::DEFAULT_STORE_ID );
46
+ $ this ->assertEquals (Store::DEFAULT_STORE_ID , $ this ->storeManager ->getStore ()->getId ());
47
+ }
48
+ }
You can’t perform that action at this time.
0 commit comments