Skip to content

Commit 1000bcd

Browse files
committed
Fix issue related with UnitTest
1 parent 4e94687 commit 1000bcd

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

app/code/Magento/Sales/Block/Status/Grid/Column/State.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@ public function decorateState($value, $row, $column, $isExport)
5757
{
5858
$states = $this->_config->getStates();
5959
if (isset($states[$value])) {
60-
$cell = $value . '[' . $states[$value] . ']';
61-
} else {
62-
$cell = $value;
60+
return sprintf("%s[%s]",
61+
$value,
62+
$states[$value]
63+
);
6364
}
64-
return $cell;
65+
66+
return $value;
6567
}
6668
}

app/code/Magento/Sales/Test/Unit/Block/Status/Grid/Column/StateTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@ public function testDecorateState()
5555
[
5656
'status' => 'fraud',
5757
'state' => 'processing',
58+
'is_default' => '0',
5859
'label' => 'Suspected Fraud',
5960
]
6061
),
6162
new \Magento\Framework\DataObject(
6263
[
6364
'status' => 'processing',
6465
'state' => 'processing',
66+
'is_default' => '1',
6567
'label' => 'Processing',
6668
]
6769
)
@@ -78,6 +80,6 @@ public function testDecorateState()
7880
->will($this->returnValue($statuses));
7981

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

0 commit comments

Comments
 (0)