Skip to content

Commit 2f513bc

Browse files
committed
Bug fix, prevent displaying 0000-00-00 00:00:00 as anything else in admin grids #10598
- Unit test added
1 parent f735e3d commit 2f513bc

File tree

1 file changed

+10
-0
lines changed
  • app/code/Magento/Ui/Test/Unit/Component/Listing/Columns

1 file changed

+10
-0
lines changed

app/code/Magento/Ui/Test/Unit/Component/Listing/Columns/DateTest.php

+10
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,14 @@ public function testPrepareDataSource()
8989
$result = $this->model->prepareDataSource(['data' => ['items' => [$item]]]);
9090
$this->assertEquals(self::TEST_TIME, $result['data']['items'][0]['field_name']);
9191
}
92+
93+
public function testPrepareDataSourceWithZeroDate()
94+
{
95+
$zeroDate = '0000-00-00 00:00:00';
96+
$item = ['test_data' => 'some_data', 'field_name' => $zeroDate];
97+
$this->timezoneMock->expects($this->never())->method('date');
98+
99+
$result = $this->model->prepareDataSource(['data' => ['items' => [$item]]]);
100+
$this->assertEquals($zeroDate, $result['data']['items'][0]['field_name']);
101+
}
92102
}

0 commit comments

Comments
 (0)