Skip to content

Commit 2387335

Browse files
author
Andrii Kasian
committed
MAGETWO-36797: Implements Index Action for PhpHandler
1 parent c6f9393 commit 2387335

File tree

1 file changed

+8
-27
lines changed
  • dev/tests/integration/testsuite/Magento/UrlRewrite/Block/Catalog/Category

1 file changed

+8
-27
lines changed

dev/tests/integration/testsuite/Magento/UrlRewrite/Block/Catalog/Category/TreeTest.php

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,36 +32,17 @@ protected function setUp()
3232

3333
/**
3434
* Test for method \Magento\UrlRewrite\Block\Catalog\Category\Tree::getTreeArray()
35+
* @magentoAppIsolation enabled
36+
* @magentoDataFixture Magento/Catalog/_files/indexer_catalog_category.php
3537
*/
3638
public function testGetTreeArray()
3739
{
38-
$expectedTreeArray = [
39-
'id' => 1,
40-
'parent_id' => 0,
41-
'children_count' => 1,
42-
'is_active' => false,
43-
'name' => 'Root',
44-
'level' => 0,
45-
'product_count' => 0,
46-
'children' => [
47-
[
48-
'id' => 2,
49-
'parent_id' => \Magento\Catalog\Model\Category::TREE_ROOT_ID,
50-
'children_count' => 0,
51-
'is_active' => true,
52-
'name' => 'Default Category',
53-
'level' => 1,
54-
'product_count' => 0,
55-
'cls' => 'active-category',
56-
'expanded' => false,
57-
'disabled' => true,
58-
],
59-
],
60-
'cls' => 'no-active-category',
61-
'expanded' => true,
62-
];
63-
64-
$this->assertEquals($expectedTreeArray, $this->_treeBlock->getTreeArray(), 'Tree array is invalid');
40+
$tree = $this->_treeBlock->getTreeArray();
41+
$this->assertEquals(6, $tree['children_count']);
42+
$this->assertEquals(false, $tree['is_active']);
43+
$this->assertEquals('Root', (string)$tree['name']);
44+
$this->assertEquals(true, $tree['expanded']);
45+
$this->assertCount(1, $tree['children']);
6546
}
6647

6748
/**

0 commit comments

Comments
 (0)