Skip to content

Commit eb04ab0

Browse files
author
Stanislav Idolov
committed
1 parent c3ea127 commit eb04ab0

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/Collection/UrlRewriteTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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
}

dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Category/CollectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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.

dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/_files/category_multiple_stores.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
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
@@ -20,6 +25,7 @@
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(
@@ -55,7 +61,6 @@
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));

0 commit comments

Comments
 (0)