Skip to content

Commit c0cd601

Browse files
committed
Menu Item input data should match what is mandated by menu.xsd
1 parent 45896ba commit c0cd601

File tree

5 files changed

+100
-98
lines changed

5 files changed

+100
-98
lines changed

app/code/Magento/Backend/Model/Menu/Item.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -466,15 +466,15 @@ public function toArray()
466466
{
467467
return [
468468
'parent_id' => $this->_parentId,
469-
'module_name' => $this->_moduleName,
469+
'module' => $this->_moduleName,
470470
'sort_index' => $this->_sortIndex,
471-
'depends_on_config' => $this->_dependsOnConfig,
471+
'dependsOnConfig' => $this->_dependsOnConfig,
472472
'id' => $this->_id,
473473
'resource' => $this->_resource,
474474
'path' => $this->_path,
475475
'action' => $this->_action,
476-
'depends_on_module' => $this->_dependsOnModule,
477-
'tooltip' => $this->_tooltip,
476+
'dependsOnModule' => $this->_dependsOnModule,
477+
'toolTip' => $this->_tooltip,
478478
'title' => $this->_title,
479479
'target' => $this->target,
480480
'sub_menu' => isset($this->_submenu) ? $this->_submenu->toArray() : null
@@ -491,15 +491,15 @@ public function toArray()
491491
public function populateFromArray(array $data)
492492
{
493493
$this->_parentId = $this->_getArgument($data, 'parent_id');
494-
$this->_moduleName = $this->_getArgument($data, 'module_name', 'Magento_Backend');
494+
$this->_moduleName = $this->_getArgument($data, 'module', 'Magento_Backend');
495495
$this->_sortIndex = $this->_getArgument($data, 'sort_index');
496-
$this->_dependsOnConfig = $this->_getArgument($data, 'depends_on_config');
496+
$this->_dependsOnConfig = $this->_getArgument($data, 'dependsOnConfig');
497497
$this->_id = $this->_getArgument($data, 'id');
498498
$this->_resource = $this->_getArgument($data, 'resource');
499499
$this->_path = $this->_getArgument($data, 'path', '');
500500
$this->_action = $this->_getArgument($data, 'action');
501-
$this->_dependsOnModule = $this->_getArgument($data, 'depends_on_module');
502-
$this->_tooltip = $this->_getArgument($data, 'tooltip', '');
501+
$this->_dependsOnModule = $this->_getArgument($data, 'dependsOnModule');
502+
$this->_tooltip = $this->_getArgument($data, 'toolTip');
503503
$this->_title = $this->_getArgument($data, 'title');
504504
$this->target = $this->_getArgument($data, 'target');
505505
if (isset($data['sub_menu'])) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ class ItemTest extends \PHPUnit\Framework\TestCase
5656
'title' => 'Item Title',
5757
'action' => '/system/config',
5858
'resource' => 'Magento_Config::config',
59-
'depends_on_module' => 'Magento_Backend',
60-
'depends_on_config' => 'system/config/isEnabled',
61-
'tooltip' => 'Item tooltip',
59+
'dependsOnModule' => 'Magento_Backend',
60+
'dependsOnConfig' => 'system/config/isEnabled',
61+
'toolTip' => 'Item tooltip',
6262
];
6363

6464
protected function setUp()

app/code/Magento/Backend/Test/Unit/Model/_files/menu_item_constructor_data.php

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212
'title' => 'Item Title',
1313
'action' => '/system/config',
1414
'resource' => 'Magento_Config::config',
15-
'depends_on_module' => 'Magento_Backend',
16-
'depends_on_config' => 'system/config/isEnabled',
17-
'tooltip' => 'Item tooltip',
15+
'dependsOnModule' => 'Magento_Backend',
16+
'dependsOnConfig' => 'system/config/isEnabled',
17+
'toolTip' => 'Item tooltip',
1818
],
1919
[
2020
'parent_id' => null,
21-
'module_name' => 'Magento_Backend',
21+
'module' => 'Magento_Backend',
2222
'sort_index' => null,
23-
'depends_on_config' => 'system/config/isEnabled',
23+
'dependsOnConfig' => 'system/config/isEnabled',
2424
'id' => 'item',
2525
'resource' => 'Magento_Config::config',
2626
'path' => '',
2727
'action' => '/system/config',
28-
'depends_on_module' => 'Magento_Backend',
29-
'tooltip' => 'Item tooltip',
28+
'dependsOnModule' => 'Magento_Backend',
29+
'toolTip' => 'Item tooltip',
3030
'title' => 'Item Title',
3131
'sub_menu' => null,
3232
'target' => null
@@ -38,43 +38,43 @@
3838
'title' => 'Item Title',
3939
'action' => '/system/config',
4040
'resource' => 'Magento_Config::config',
41-
'depends_on_module' => 'Magento_Backend',
42-
'depends_on_config' => 'system/config/isEnabled',
43-
'tooltip' => 'Item tooltip',
41+
'dependsOnModule' => 'Magento_Backend',
42+
'dependsOnConfig' => 'system/config/isEnabled',
43+
'toolTip' => 'Item tooltip',
4444
],
4545
[
4646
'parent_id' => '1',
47-
'module_name' => 'Magento_Module1',
47+
'module' => 'Magento_Module1',
4848
'sort_index' => '50',
49-
'depends_on_config' => null,
49+
'dependsOnConfig' => null,
5050
'id' => '5',
5151
'resource' => null,
5252
'path' => null,
5353
'action' => null,
54-
'depends_on_module' => null,
55-
'tooltip' => null,
54+
'dependsOnModule' => null,
55+
'toolTip' => null,
5656
'title' => null,
5757
'sub_menu' => [
5858
'id' => 'item',
5959
'title' => 'Item Title',
6060
'action' => '/system/config',
6161
'resource' => 'Magento_Config::config',
62-
'depends_on_module' => 'Magento_Backend',
63-
'depends_on_config' => 'system/config/isEnabled',
64-
'tooltip' => 'Item tooltip',
62+
'dependsOnModule' => 'Magento_Backend',
63+
'dependsOnConfig' => 'system/config/isEnabled',
64+
'toolTip' => 'Item tooltip',
6565
],
6666
],
6767
[
6868
'parent_id' => '1',
69-
'module_name' => 'Magento_Module1',
69+
'module' => 'Magento_Module1',
7070
'sort_index' => '50',
71-
'depends_on_config' => null,
71+
'dependsOnConfig' => null,
7272
'id' => '5',
7373
'resource' => null,
7474
'path' => '',
7575
'action' => null,
76-
'depends_on_module' => null,
77-
'tooltip' => '',
76+
'dependsOnModule' => null,
77+
'toolTip' => '',
7878
'title' => null,
7979
'sub_menu' => ['submenuArray'],
8080
'target' => null
@@ -83,51 +83,51 @@
8383
'data with submenu to constructor' => [
8484
[
8585
'parent_id' => '1',
86-
'module_name' => 'Magento_Module1',
86+
'module' => 'Magento_Module1',
8787
'sort_index' => '50',
88-
'depends_on_config' => null,
88+
'dependsOnConfig' => null,
8989
'id' => '5',
9090
'resource' => null,
9191
'path' => null,
9292
'action' => null,
93-
'depends_on_module' => null,
94-
'tooltip' => null,
93+
'dependsOnModule' => null,
94+
'toolTip' => null,
9595
'title' => null,
9696
'sub_menu' => [
9797
'id' => 'item',
9898
'title' => 'Item Title',
9999
'action' => '/system/config',
100100
'resource' => 'Magento_Config::config',
101-
'depends_on_module' => 'Magento_Backend',
102-
'depends_on_config' => 'system/config/isEnabled',
103-
'tooltip' => 'Item tooltip',
101+
'dependsOnModule' => 'Magento_Backend',
102+
'dependsOnConfig' => 'system/config/isEnabled',
103+
'toolTip' => 'Item tooltip',
104104
],
105105
],
106106
[
107107
'parent_id' => '1',
108-
'module_name' => 'Magento_Module1',
108+
'module' => 'Magento_Module1',
109109
'sort_index' => '50',
110110
'sub_menu' => [
111111
'id' => 'item',
112112
'title' => 'Item Title',
113113
'action' => '/system/config',
114114
'resource' => 'Magento_Config::config',
115-
'depends_on_module' => 'Magento_Backend',
116-
'depends_on_config' => 'system/config/isEnabled',
117-
'tooltip' => 'Item tooltip',
115+
'dependsOnModule' => 'Magento_Backend',
116+
'dependsOnConfig' => 'system/config/isEnabled',
117+
'toolTip' => 'Item tooltip',
118118
],
119119
],
120120
[
121121
'parent_id' => '1',
122-
'module_name' => 'Magento_Module1',
122+
'module' => 'Magento_Module1',
123123
'sort_index' => '50',
124-
'depends_on_config' => null,
124+
'dependsOnConfig' => null,
125125
'id' => null,
126126
'resource' => null,
127127
'path' => '',
128128
'action' => null,
129-
'depends_on_module' => null,
130-
'tooltip' => '',
129+
'dependsOnModule' => null,
130+
'toolTip' => '',
131131
'title' => null,
132132
'sub_menu' => ['submenuArray'],
133133
'target' => null

app/code/Magento/Backend/Test/Unit/Model/_files/menu_item_data.php

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@
1111
'title' => 'Item Title',
1212
'action' => '/system/config',
1313
'resource' => 'Magento_Config::config',
14-
'depends_on_module' => 'Magento_Backend',
15-
'depends_on_config' => 'system/config/isEnabled',
16-
'tooltip' => 'Item tooltip',
14+
'dependsOnModule' => 'Magento_Backend',
15+
'dependsOnConfig' => 'system/config/isEnabled',
16+
'toolTip' => 'Item tooltip',
1717
'sub_menu' => null,
1818
],
1919
[
2020
'parent_id' => null,
21-
'module_name' => 'Magento_Backend',
21+
'module' => 'Magento_Backend',
2222
'sort_index' => null,
23-
'depends_on_config' => 'system/config/isEnabled',
23+
'dependsOnConfig' => 'system/config/isEnabled',
2424
'id' => 'item',
2525
'resource' => 'Magento_Config::config',
2626
'path' => '',
2727
'action' => '/system/config',
28-
'depends_on_module' => 'Magento_Backend',
29-
'tooltip' => 'Item tooltip',
28+
'dependsOnModule' => 'Magento_Backend',
29+
'toolTip' => 'Item tooltip',
3030
'title' => 'Item Title',
3131
'sub_menu' => null,
3232
'target' => null
@@ -35,85 +35,85 @@
3535
'with submenu' => [
3636
[
3737
'parent_id' => '1',
38-
'module_name' => 'Magento_Module1',
38+
'module' => 'Magento_Module1',
3939
'sort_index' => '50',
40-
'depends_on_config' => null,
40+
'dependsOnConfig' => null,
4141
'id' => '5',
4242
'resource' => null,
4343
'path' => null,
4444
'action' => null,
45-
'depends_on_module' => null,
46-
'tooltip' => null,
45+
'dependsOnModule' => null,
46+
'toolTip' => null,
4747
'title' => null,
4848
'sub_menu' => [
4949
'id' => 'item',
5050
'title' => 'Item Title',
5151
'action' => '/system/config',
5252
'resource' => 'Magento_Config::config',
53-
'depends_on_module' => 'Magento_Backend',
54-
'depends_on_config' => 'system/config/isEnabled',
55-
'tooltip' => 'Item tooltip',
53+
'dependsOnModule' => 'Magento_Backend',
54+
'dependsOnConfig' => 'system/config/isEnabled',
55+
'toolTip' => 'Item tooltip',
5656
],
5757
],
5858
[
5959
'parent_id' => '1',
60-
'module_name' => 'Magento_Module1',
60+
'module' => 'Magento_Module1',
6161
'sort_index' => '50',
62-
'depends_on_config' => null,
62+
'dependsOnConfig' => null,
6363
'id' => '5',
6464
'resource' => null,
6565
'path' => null,
6666
'action' => null,
67-
'depends_on_module' => null,
68-
'tooltip' => '',
67+
'dependsOnModule' => null,
68+
'toolTip' => '',
6969
'title' => null,
7070
'sub_menu' => [
7171
'id' => 'item',
7272
'title' => 'Item Title',
7373
'action' => '/system/config',
7474
'resource' => 'Magento_Config::config',
75-
'depends_on_module' => 'Magento_Backend',
76-
'depends_on_config' => 'system/config/isEnabled',
77-
'tooltip' => 'Item tooltip',
75+
'dependsOnModule' => 'Magento_Backend',
76+
'dependsOnConfig' => 'system/config/isEnabled',
77+
'toolTip' => 'Item tooltip',
7878
],
7979
'target' => null
8080
]
8181
],
8282
'small set of data' => [
8383
[
8484
'parent_id' => '1',
85-
'module_name' => 'Magento_Module1',
85+
'module' => 'Magento_Module1',
8686
'sort_index' => '50',
8787
'sub_menu' => [
8888
'id' => 'item',
8989
'title' => 'Item Title',
9090
'action' => '/system/config',
9191
'resource' => 'Magento_Config::config',
92-
'depends_on_module' => 'Magento_Backend',
93-
'depends_on_config' => 'system/config/isEnabled',
94-
'tooltip' => 'Item tooltip',
92+
'dependsOnModule' => 'Magento_Backend',
93+
'dependsOnConfig' => 'system/config/isEnabled',
94+
'toolTip' => 'Item tooltip',
9595
],
9696
],
9797
[
9898
'parent_id' => '1',
99-
'module_name' => 'Magento_Module1',
99+
'module' => 'Magento_Module1',
100100
'sort_index' => '50',
101-
'depends_on_config' => null,
101+
'dependsOnConfig' => null,
102102
'id' => null,
103103
'resource' => null,
104104
'path' => '',
105105
'action' => null,
106-
'depends_on_module' => null,
107-
'tooltip' => '',
106+
'dependsOnModule' => null,
107+
'toolTip' => '',
108108
'title' => null,
109109
'sub_menu' => [
110110
'id' => 'item',
111111
'title' => 'Item Title',
112112
'action' => '/system/config',
113113
'resource' => 'Magento_Config::config',
114-
'depends_on_module' => 'Magento_Backend',
115-
'depends_on_config' => 'system/config/isEnabled',
116-
'tooltip' => 'Item tooltip',
114+
'dependsOnModule' => 'Magento_Backend',
115+
'dependsOnConfig' => 'system/config/isEnabled',
116+
'toolTip' => 'Item tooltip',
117117
],
118118
'target' => null
119119
]

0 commit comments

Comments
 (0)