File tree Expand file tree Collapse file tree 2 files changed +40
-1
lines changed
Model/ResourceModel/Category
Test/Unit/Model/ResourceModel/Category/Collection Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -311,7 +311,7 @@ public function joinUrlRewrite()
311
311
['request_path ' ],
312
312
sprintf (
313
313
'{{table}}.is_autogenerated = 1 AND {{table}}.store_id = %d AND {{table}}.entity_type = \'%s \'' ,
314
- $ this ->_storeManager -> getStore ()-> getId (),
314
+ $ this ->getStoreId (),
315
315
CategoryUrlRewriteGenerator::ENTITY_TYPE
316
316
),
317
317
'left '
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ namespace Magento \Catalog \Test \Unit \Model \ResourceModel \Category \Collection ;
8
+
9
+ class UrlRewriteTest extends \PHPUnit_Framework_TestCase
10
+ {
11
+ /**
12
+ * @var \PHPUnit_Framework_MockObject_MockObject
13
+ */
14
+ protected $ _model ;
15
+
16
+ protected function setUp ()
17
+ {
18
+ $ this ->_model = $ this ->getMockBuilder (\Magento \Catalog \Model \ResourceModel \Category \Collection::class)
19
+ ->disableOriginalConstructor ()
20
+ ->setMethods (['joinTable ' ])
21
+ ->getMock ();
22
+ }
23
+
24
+ public function testStoreIdUsedByUrlRewrite ()
25
+ {
26
+ $ cond = '{{table}}.is_autogenerated = 1 AND {{table}}.store_id = 100 AND {{table}}.entity_type = \'category \'' ;
27
+ $ this ->_model ->expects ($ this ->once ())
28
+ ->method ('joinTable ' )
29
+ ->with (
30
+ $ this ->anything (),
31
+ $ this ->anything (),
32
+ $ this ->anything (),
33
+ $ this ->equalTo ($ cond ),
34
+ $ this ->anything ()
35
+ );
36
+ $ this ->_model ->setStoreId (100 );
37
+ $ this ->_model ->joinUrlRewrite ();
38
+ }
39
+ }
You can’t perform that action at this time.
0 commit comments