File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 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
1111 /**
1212 * @var \PHPUnit_Framework_MockObject_MockObject
1313 */
14- protected $ _model ;
14+ private $ model ;
1515
1616 protected function setUp ()
1717 {
18- $ this ->_model = $ this ->getMockBuilder (\Magento \Catalog \Model \ResourceModel \Category \Collection::class)
18+ $ this ->model = $ this ->getMockBuilder (\Magento \Catalog \Model \ResourceModel \Category \Collection::class)
1919 ->disableOriginalConstructor ()
2020 ->setMethodsExcept (['joinUrlRewrite ' , 'setStoreId ' , 'getStoreId ' ])
2121 ->getMock ();
@@ -24,7 +24,7 @@ protected function setUp()
2424 public function testStoreIdUsedByUrlRewrite ()
2525 {
2626 $ 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 ())
2828 ->method ('joinTable ' )
2929 ->with (
3030 $ this ->anything (),
@@ -33,7 +33,7 @@ public function testStoreIdUsedByUrlRewrite()
3333 $ this ->equalTo ($ cond ),
3434 $ this ->anything ()
3535 );
36- $ this ->_model ->setStoreId (100 );
37- $ this ->_model ->joinUrlRewrite ();
36+ $ this ->model ->setStoreId (100 );
37+ $ this ->model ->joinUrlRewrite ();
3838 }
3939}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class CollectionTest extends \PHPUnit\Framework\TestCase
1010 /**
1111 * @var \Magento\Catalog\Model\ResourceModel\Category\Collection
1212 */
13- protected $ collection ;
13+ private $ collection ;
1414
1515 /**
1616 * Sets up the fixture, for example, opens a network connection.
Original file line number Diff line number Diff line change 11<?php
2+ /**
3+ * Copyright © Magento, Inc. All rights reserved.
4+ * See COPYING.txt for license details.
5+ */
6+
27/** @var \Magento\Catalog\Model\CategoryFactory $factory */
38$ factory = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
49 \Magento \Catalog \Model \CategoryFactory::class
2025 $ groupId = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->get (
2126 \Magento \Store \Model \StoreManagerInterface::class
2227 )->getWebsite ()->getDefaultGroupId ();
28+
2329 $ store ->setCode (
2430 'second_category_store '
2531 )->setWebsiteId (
5561$ repository ->save ($ newCategory );
5662$ currentStoreId = $ storeManager ->getStore ()->getId ();
5763$ storeManager ->setCurrentStore ($ storeManager ->getStore ($ store ->getId ()));
58- $ newCategory
59- ->setUrlKey ('category-3-on-2 ' );
64+ $ newCategory ->setUrlKey ('category-3-on-2 ' );
6065$ repository ->save ($ newCategory );
6166$ storeManager ->setCurrentStore ($ storeManager ->getStore ($ currentStoreId ));
You can’t perform that action at this time.
0 commit comments