Skip to content

Commit db2b978

Browse files
committed
MC-18762: Fix incorrect website name rendering
1 parent 5905592 commit db2b978

File tree

4 files changed

+29
-27
lines changed

4 files changed

+29
-27
lines changed

app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/Cms/OptionsTest.php

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function testToOptionArray()
7171
$expectedOptions = [
7272
[
7373
'label' => __('All Store Views'),
74-
'value' => '0'
74+
'value' => '0',
7575
],
7676
[
7777
'label' => 'Main Website',
@@ -81,11 +81,14 @@ public function testToOptionArray()
8181
'value' => [
8282
[
8383
'label' => ' Default Store View',
84-
'value' => '1'
84+
'value' => '1',
85+
'__disableTmpl' => true,
8586
]
86-
]
87+
],
88+
'__disableTmpl' => true,
8789
]
88-
]
90+
],
91+
'__disableTmpl' => true,
8992
]
9093
];
9194

@@ -104,14 +107,6 @@ public function testToOptionArray()
104107
$this->storeMock->expects($this->atLeastOnce())->method('getName')->willReturn('Default Store View');
105108
$this->storeMock->expects($this->atLeastOnce())->method('getId')->willReturn('1');
106109

107-
$this->escaperMock->expects($this->atLeastOnce())->method('escapeHtml')->willReturnMap(
108-
[
109-
['Default Store View', null, 'Default Store View'],
110-
['Main Website Store', null, 'Main Website Store'],
111-
['Main Website', null, 'Main Website']
112-
]
113-
);
114-
115110
$this->assertEquals($expectedOptions, $this->options->toOptionArray());
116111
}
117112
}

app/code/Magento/Store/Ui/Component/Listing/Column/Store/Options.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ protected function generateCurrentOptions()
9999
$groups[$name]['label'] = str_repeat(' ', 4) . $name;
100100
$groups[$name]['value'] = array_values($stores);
101101
$groups[$name]['__disableTmpl'] = true;
102-
103102
}
104103
}
105104
}

dev/tests/integration/testsuite/Magento/UrlRewrite/Block/Catalog/Edit/FormTest.php

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,11 @@ public static function getEntityStoresDataProvider()
237237
['label' => 'Main Website', 'value' => [], '__disableTmpl' => true],
238238
[
239239
'label' => '    Main Website Store',
240-
'value' => [['label' => '    Default Store View', 'value' => 1]],
241-
'__disableTmpl' => true
242-
]
240+
'value' => [
241+
['label' => '    Default Store View', 'value' => 1, '__disableTmpl' => true],
242+
],
243+
'__disableTmpl' => true,
244+
],
243245
],
244246
],
245247
[
@@ -249,10 +251,12 @@ public static function getEntityStoresDataProvider()
249251
['label' => 'Main Website', 'value' => [], '__disableTmpl' => true],
250252
[
251253
'label' => '    Main Website Store',
252-
'value' => [['label' => '    Default Store View', 'value' => 1]],
253-
'__disableTmpl' => true
254-
]
255-
]
254+
'value' => [
255+
['label' => '    Default Store View', 'value' => 1, '__disableTmpl' => true],
256+
],
257+
'__disableTmpl' => true,
258+
],
259+
],
256260
],
257261
[
258262
['entity_id' => 2, 'name' => 'product2', 'url_key' => 'product2', 'store_ids' => [1]],
@@ -261,11 +265,13 @@ public static function getEntityStoresDataProvider()
261265
['label' => 'Main Website', 'value' => [], '__disableTmpl' => true],
262266
[
263267
'label' => '    Main Website Store',
264-
'value' => [['label' => '    Default Store View', 'value' => 1]],
265-
'__disableTmpl' => true
266-
]
267-
]
268-
]
268+
'value' => [
269+
['label' => '    Default Store View', 'value' => 1, '__disableTmpl' => true],
270+
],
271+
'__disableTmpl' => true,
272+
],
273+
],
274+
],
269275
];
270276
}
271277
}

dev/tests/integration/testsuite/Magento/UrlRewrite/Block/Cms/Page/Edit/FormTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ public function testGetEntityStores()
8181
['label' => 'Main Website', 'value' => [], '__disableTmpl' => true],
8282
[
8383
'label' => '    Main Website Store',
84-
'value' => [['label' => '    Default Store View', 'value' => 1]],
85-
'__disableTmpl' => true
84+
'value' => [
85+
['label' => '    Default Store View', 'value' => 1, '__disableTmpl' => true]
86+
],
87+
'__disableTmpl' => true,
8688
],
8789
];
8890
$this->assertEquals($expectedStores, $form->getElement('store_id')->getValues());

0 commit comments

Comments
 (0)