Skip to content

Commit 85a64d9

Browse files
committed
MAGETWO-57153: [Backport] - [Github] Custom options not displayed correctly on a store view level #2908 #5885 #5612 - for 2.1
1 parent 1d569e2 commit 85a64d9

File tree

4 files changed

+10
-14
lines changed
  • app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Validator
  • dev/tests

4 files changed

+10
-14
lines changed

app/code/Magento/Catalog/Test/Unit/Model/Product/Option/Validator/SelectTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ public function isValidateWithInvalidDataDataProvider()
172172
*/
173173
public function testValidateWithDeletedOptionValue(array $value, $isValid)
174174
{
175-
$this->valueMock->expects($this->once())->method('getTitle')->will($this->returnValue('option_title'));
176-
$this->valueMock->expects($this->exactly(2))->method('getType')->will($this->returnValue('name 1.1'));
175+
$this->valueMock->expects($this->once())->method('getTitle')->willReturn('option_title');
176+
$this->valueMock->expects($this->exactly(2))->method('getType')->willReturn('name 1.1');
177177
$this->valueMock->expects($this->never())->method('getPriceType');
178178
$this->valueMock->expects($this->never())->method('getPrice');
179-
$this->valueMock->expects($this->any())->method('getData')->with('values')->will($this->returnValue($value));
179+
$this->valueMock->expects($this->any())->method('getData')->with('values')->willReturn($value);
180180

181181
$this->assertEquals($isValid, $this->validator->isValid($this->valueMock));
182182
}
@@ -208,8 +208,7 @@ public function validateDeletedOptionValueDataProvider()
208208
],
209209
[
210210
'price_type' => 'fixed',
211-
'price' => 11,
212-
'title' => 'Title 2',
211+
'price' => -11,
213212
'is_delete' => 1,
214213
],
215214
],

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class Options extends Section
2424
* Determines if we need update option or add new one.
2525
*/
2626
const ACTION_ADD = 'add';
27-
const ACTION_UPDATE = 'update';
2827
/**#@-*/
2928

3029
/**
@@ -190,7 +189,7 @@ private function setOptionTypeData(array $options, $type, ElementInterface $elem
190189
}
191190

192191
if (!isset($option['action_type'])) {
193-
$option['action_type'] = static::ACTION_ADD;
192+
$option['action_type'] = self::ACTION_ADD;
194193
}
195194

196195
$optionsForm->fillOptions(
@@ -355,14 +354,14 @@ protected function optionNameConvert($inputType)
355354
* @param array $field
356355
* @return void
357356
*/
358-
private function processField($keyRoot, array &$field)
357+
private function processField($keyRoot, array $field)
359358
{
360359
$options = null;
361360

362-
$actionType = isset($field['action_type']) ? $field['action_type'] : static::ACTION_ADD;
361+
$actionType = isset($field['action_type']) ? $field['action_type'] : self::ACTION_ADD;
363362
unset($field['action_type']);
364363

365-
if ($actionType == static::ACTION_ADD) {
364+
if ($actionType == self::ACTION_ADD) {
366365
$this->_rootElement->find($this->buttonAddOption)->click();
367366
}
368367

dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/Option/ValueTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ public function testSaveValueTitleCustomStore()
7171
*/
7272
public function testRemoveValueTitleCustomStore()
7373
{
74-
$this->testSaveValueTitleCustomStore();
75-
74+
$this->saveOptionValue($this->store, ['title' => 'option 1 Custom Store']);
7675
$this->saveOptionValue($this->store, ['title' => 'option 1 Custom Store', 'is_delete_store_title' => 1]);
7776

7877
self::assertEquals('drop_down option 1', $this->getValueTitle());

dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/OptionTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ public function testSaveOptionTitleCustomStore()
7171
*/
7272
public function testRemoveOptionTitleCustomStore()
7373
{
74-
$this->testSaveOptionTitleCustomStore();
75-
74+
$this->saveOption($this->store, ['title' => 'drop_down option Custom Store']);
7675
$this->saveOption($this->store, ['title' => 'drop_down option Custom Store', 'is_delete_store_title' => 1]);
7776

7877
self::assertEquals('drop_down option', $this->getOptionTitle());

0 commit comments

Comments
 (0)