Skip to content

Commit db18877

Browse files
#24103: Refactoring.
1 parent eaa59d2 commit db18877

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ public function __construct(Context $context, Data $urlHelper, array $data = [])
4747
*/
4848
public function render(DataObject $row)
4949
{
50-
$readDetailsHtml = $row->getData('url') ? '<a class="action-details" target="_blank" href="' .
51-
$this->escapeUrl($row->getData('url'))
50+
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' .
51+
$this->escapeUrl($row->getUrl())
5252
. '">' .
5353
__('Read Details') . '</a>' : '';
5454

55-
$markAsReadHtml = !$row->getData('is_read') ? '<a class="action-mark" href="' . $this->getUrl(
55+
$markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl(
5656
'*/*/markAsRead/',
57-
['_current' => true, 'id' => $row->getData('notification_id')]
57+
['_current' => true, 'id' => $row->getNotificationId()]
5858
) . '">' . __(
5959
'Mark as Read'
6060
) . '</a>' : '';
@@ -68,7 +68,7 @@ public function render(DataObject $row)
6868
'*/*/remove/',
6969
[
7070
'_current' => true,
71-
'id' => $row->getData('notification_id'),
71+
'id' => $row->getNotificationId(),
7272
ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl
7373
]
7474
),

app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class Notice extends AbstractRenderer
2828
public function render(DataObject $row)
2929
{
3030
return '<span class="grid-row-title">' .
31-
$this->escapeHtml($row->getData('title')) .
31+
$this->escapeHtml($row->getTitle()) .
3232
'</span>' .
33-
($row->getData('description') ? '<br />' . $this->escapeHtml($row->getData('description')) : '');
33+
($row->getDescription() ? '<br />' . $this->escapeHtml($row->getDescription()) : '');
3434
}
3535
}

app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function render(DataObject $row)
5050
$value = '';
5151

5252
$column = $this->getColumn();
53-
$index = $column->getData('index');
53+
$index = $column->getIndex();
5454
switch ($row->getData($index)) {
5555
case MessageInterface::SEVERITY_CRITICAL:
5656
$class = 'critical';

app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/SeverityTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ protected function setUp() : void
4444
public function testShouldRenderSeverity() : void
4545
{
4646
/** @var Column | \PHPUnit_Framework_MockObject_MockObject $columnMock */
47-
$columnMock = $this->getMockBuilder(Column::class)->disableOriginalConstructor()->getMock();
48-
$columnMock->expects($this->exactly(5))->method('getData')->with($this->equalTo('index'))->willReturn('index');
47+
$columnMock = $this->getMockBuilder(Column::class)
48+
->disableOriginalConstructor()
49+
->setMethods(['getIndex'])
50+
->getMock();
51+
$columnMock->expects($this->exactly(5))->method('getIndex')->willReturn('index');
4952
$this->sut->setColumn($columnMock);
5053
$dataObject = new DataObject();
5154

0 commit comments

Comments
 (0)