Skip to content

Commit

Permalink
MAGETWO-57153: [Backport] - [Github] Custom options not displayed cor…
Browse files Browse the repository at this point in the history
…rectly on a store view level #2908 #5885 #5612 - for 2.1
  • Loading branch information
ameysar committed Sep 28, 2017
1 parent 1d569e2 commit 85a64d9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ public function isValidateWithInvalidDataDataProvider()
*/
public function testValidateWithDeletedOptionValue(array $value, $isValid)
{
$this->valueMock->expects($this->once())->method('getTitle')->will($this->returnValue('option_title'));
$this->valueMock->expects($this->exactly(2))->method('getType')->will($this->returnValue('name 1.1'));
$this->valueMock->expects($this->once())->method('getTitle')->willReturn('option_title');
$this->valueMock->expects($this->exactly(2))->method('getType')->willReturn('name 1.1');
$this->valueMock->expects($this->never())->method('getPriceType');
$this->valueMock->expects($this->never())->method('getPrice');
$this->valueMock->expects($this->any())->method('getData')->with('values')->will($this->returnValue($value));
$this->valueMock->expects($this->any())->method('getData')->with('values')->willReturn($value);

$this->assertEquals($isValid, $this->validator->isValid($this->valueMock));
}
Expand Down Expand Up @@ -208,8 +208,7 @@ public function validateDeletedOptionValueDataProvider()
],
[
'price_type' => 'fixed',
'price' => 11,
'title' => 'Title 2',
'price' => -11,
'is_delete' => 1,
],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Options extends Section
* Determines if we need update option or add new one.
*/
const ACTION_ADD = 'add';
const ACTION_UPDATE = 'update';
/**#@-*/

/**
Expand Down Expand Up @@ -190,7 +189,7 @@ private function setOptionTypeData(array $options, $type, ElementInterface $elem
}

if (!isset($option['action_type'])) {
$option['action_type'] = static::ACTION_ADD;
$option['action_type'] = self::ACTION_ADD;
}

$optionsForm->fillOptions(
Expand Down Expand Up @@ -355,14 +354,14 @@ protected function optionNameConvert($inputType)
* @param array $field
* @return void
*/
private function processField($keyRoot, array &$field)
private function processField($keyRoot, array $field)
{
$options = null;

$actionType = isset($field['action_type']) ? $field['action_type'] : static::ACTION_ADD;
$actionType = isset($field['action_type']) ? $field['action_type'] : self::ACTION_ADD;
unset($field['action_type']);

if ($actionType == static::ACTION_ADD) {
if ($actionType == self::ACTION_ADD) {
$this->_rootElement->find($this->buttonAddOption)->click();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ public function testSaveValueTitleCustomStore()
*/
public function testRemoveValueTitleCustomStore()
{
$this->testSaveValueTitleCustomStore();

$this->saveOptionValue($this->store, ['title' => 'option 1 Custom Store']);
$this->saveOptionValue($this->store, ['title' => 'option 1 Custom Store', 'is_delete_store_title' => 1]);

self::assertEquals('drop_down option 1', $this->getValueTitle());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ public function testSaveOptionTitleCustomStore()
*/
public function testRemoveOptionTitleCustomStore()
{
$this->testSaveOptionTitleCustomStore();

$this->saveOption($this->store, ['title' => 'drop_down option Custom Store']);
$this->saveOption($this->store, ['title' => 'drop_down option Custom Store', 'is_delete_store_title' => 1]);

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

0 comments on commit 85a64d9

Please sign in to comment.