File tree 3 files changed +13
-8
lines changed
app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/Collection
dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel
3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,11 @@ class UrlRewriteTest extends \PHPUnit\Framework\TestCase
11
11
/**
12
12
* @var \PHPUnit_Framework_MockObject_MockObject
13
13
*/
14
- protected $ _model ;
14
+ private $ model ;
15
15
16
16
protected function setUp ()
17
17
{
18
- $ this ->_model = $ this ->getMockBuilder (\Magento \Catalog \Model \ResourceModel \Category \Collection::class)
18
+ $ this ->model = $ this ->getMockBuilder (\Magento \Catalog \Model \ResourceModel \Category \Collection::class)
19
19
->disableOriginalConstructor ()
20
20
->setMethodsExcept (['joinUrlRewrite ' , 'setStoreId ' , 'getStoreId ' ])
21
21
->getMock ();
@@ -24,7 +24,7 @@ protected function setUp()
24
24
public function testStoreIdUsedByUrlRewrite ()
25
25
{
26
26
$ cond = '{{table}}.is_autogenerated = 1 AND {{table}}.store_id = 100 AND {{table}}.entity_type = \'category \'' ;
27
- $ this ->_model ->expects ($ this ->once ())
27
+ $ this ->model ->expects ($ this ->once ())
28
28
->method ('joinTable ' )
29
29
->with (
30
30
$ this ->anything (),
@@ -33,7 +33,7 @@ public function testStoreIdUsedByUrlRewrite()
33
33
$ this ->equalTo ($ cond ),
34
34
$ this ->anything ()
35
35
);
36
- $ this ->_model ->setStoreId (100 );
37
- $ this ->_model ->joinUrlRewrite ();
36
+ $ this ->model ->setStoreId (100 );
37
+ $ this ->model ->joinUrlRewrite ();
38
38
}
39
39
}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class CollectionTest extends \PHPUnit\Framework\TestCase
10
10
/**
11
11
* @var \Magento\Catalog\Model\ResourceModel\Category\Collection
12
12
*/
13
- protected $ collection ;
13
+ private $ collection ;
14
14
15
15
/**
16
16
* Sets up the fixture, for example, opens a network connection.
Original file line number Diff line number Diff line change 1
1
<?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
2
7
/** @var \Magento\Catalog\Model\CategoryFactory $factory */
3
8
$ factory = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
4
9
\Magento \Catalog \Model \CategoryFactory::class
20
25
$ groupId = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->get (
21
26
\Magento \Store \Model \StoreManagerInterface::class
22
27
)->getWebsite ()->getDefaultGroupId ();
28
+
23
29
$ store ->setCode (
24
30
'second_category_store '
25
31
)->setWebsiteId (
55
61
$ repository ->save ($ newCategory );
56
62
$ currentStoreId = $ storeManager ->getStore ()->getId ();
57
63
$ storeManager ->setCurrentStore ($ storeManager ->getStore ($ store ->getId ()));
58
- $ newCategory
59
- ->setUrlKey ('category-3-on-2 ' );
64
+ $ newCategory ->setUrlKey ('category-3-on-2 ' );
60
65
$ repository ->save ($ newCategory );
61
66
$ storeManager ->setCurrentStore ($ storeManager ->getStore ($ currentStoreId ));
You can’t perform that action at this time.
0 commit comments