Skip to content

Commit 81c7c12

Browse files
committed
Merge branch 'MAGETWO-85030' into Chaika_2.1.13_PR4
2 parents 22af11e + 05e98d6 commit 81c7c12

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Model/CategoryTreeTest.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Catalog\Model;
78

9+
use Magento\TestFramework\Helper\Bootstrap;
10+
811
/**
912
* Test class for \Magento\Catalog\Model\Category.
1013
* - tree knowledge is tested
@@ -23,9 +26,7 @@ class CategoryTreeTest extends \PHPUnit_Framework_TestCase
2326

2427
protected function setUp()
2528
{
26-
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
27-
'Magento\Catalog\Model\Category'
28-
);
29+
$this->_model = Bootstrap::getObjectManager()->create(Category::class);
2930
}
3031

3132
/**
@@ -125,7 +126,7 @@ public function testGetParentIds()
125126
public function testGetChildren()
126127
{
127128
$this->_model->load(3);
128-
$this->assertEquals('4,13', $this->_model->getChildren());
129+
$this->assertEquals([], array_diff([4, 13], explode(',', $this->_model->getChildren())));
129130
}
130131

131132
public function testGetPathInStore()
@@ -172,28 +173,28 @@ public function testGetParentCategories()
172173
{
173174
$this->_model->load(5);
174175
$parents = $this->_model->getParentCategories();
175-
$this->assertEquals(3, count($parents));
176+
$this->assertCount(3, $parents);
176177
}
177178

178179
public function testGetParentCategoriesEmpty()
179180
{
180181
$this->_model->load(1);
181182
$parents = $this->_model->getParentCategories();
182-
$this->assertEquals(0, count($parents));
183+
$this->assertCount(0, $parents);
183184
}
184185

185186
public function testGetChildrenCategories()
186187
{
187188
$this->_model->load(3);
188189
$children = $this->_model->getChildrenCategories();
189-
$this->assertEquals(2, count($children));
190+
$this->assertCount(2, $children);
190191
}
191192

192193
public function testGetChildrenCategoriesEmpty()
193194
{
194195
$this->_model->load(5);
195196
$children = $this->_model->getChildrenCategories();
196-
$this->assertEquals(0, count($children));
197+
$this->assertCount(0, $children);
197198
}
198199

199200
public function testGetParentDesignCategory()

0 commit comments

Comments
 (0)