Skip to content

Commit 9b16e36

Browse files
author
Joan He
committed
MAGETWO-62253: Refactor code to remove unserialize
- address code review comments
1 parent d2efda3 commit 9b16e36

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

app/code/Magento/Backend/Test/Unit/Model/Menu/ItemTest.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public function testPopulateFromArray(
377377
$menuMock = $this->getMock(\Magento\Backend\Model\Menu::class, [], [], '', false);
378378
$this->_menuFactoryMock->method('create')->will($this->returnValue($menuMock));
379379
$menuMock->method('toArray')
380-
->willReturn(isset($constructorData['sub_menu']) ? $constructorData['sub_menu'] : null);
380+
->willReturn(['submenuArray']);
381381

382382
$model = $this->objectManager->getObject(
383383
\Magento\Backend\Model\Menu\Item::class,
@@ -468,7 +468,7 @@ public function populateFromArrayDataProvider()
468468
'depends_on_module' => null,
469469
'tooltip' => '',
470470
'title' => null,
471-
'sub_menu' => null
471+
'sub_menu' => ['submenuArray']
472472
],
473473
],
474474
'data with submenu to constructor' => [
@@ -520,15 +520,7 @@ public function populateFromArrayDataProvider()
520520
'depends_on_module' => null,
521521
'tooltip' => '',
522522
'title' => null,
523-
'sub_menu' => [
524-
'id' => 'item',
525-
'title' => 'Item Title',
526-
'action' => '/system/config',
527-
'resource' => 'Magento_Config::config',
528-
'depends_on_module' => 'Magento_Backend',
529-
'depends_on_config' => 'system/config/isEnabled',
530-
'tooltip' => 'Item tooltip',
531-
]
523+
'sub_menu' => ['submenuArray']
532524
],
533525
]
534526
];

0 commit comments

Comments
 (0)