Skip to content

Commit

Permalink
Fix issue related with UnitTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Usik2203 committed Jan 29, 2020
1 parent 4e94687 commit 1000bcd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions app/code/Magento/Sales/Block/Status/Grid/Column/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ public function decorateState($value, $row, $column, $isExport)
{
$states = $this->_config->getStates();
if (isset($states[$value])) {
$cell = $value . '[' . $states[$value] . ']';
} else {
$cell = $value;
return sprintf("%s[%s]",
$value,
$states[$value]
);
}
return $cell;

return $value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ public function testDecorateState()
[
'status' => 'fraud',
'state' => 'processing',
'is_default' => '0',
'label' => 'Suspected Fraud',
]
),
new \Magento\Framework\DataObject(
[
'status' => 'processing',
'state' => 'processing',
'is_default' => '1',
'label' => 'Processing',
]
)
Expand All @@ -78,6 +80,6 @@ public function testDecorateState()
->will($this->returnValue($statuses));

$result = $this->stateColumn->decorateState('processing', $rowMock, $columnMock, false);
$this->assertSame('processing[Suspected Fraud]', $result);
$this->assertSame('processing[Processing]', $result);
}
}

0 comments on commit 1000bcd

Please sign in to comment.