Skip to content

Commit

Permalink
Bug fix, prevent displaying 0000-00-00 00:00:00 as anything else in…
Browse files Browse the repository at this point in the history
… admin grids #10598

 - Unit test added
  • Loading branch information
ishakhsuvarov committed Aug 22, 2017
1 parent f735e3d commit 2f513bc
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,14 @@ public function testPrepareDataSource()
$result = $this->model->prepareDataSource(['data' => ['items' => [$item]]]);
$this->assertEquals(self::TEST_TIME, $result['data']['items'][0]['field_name']);
}

public function testPrepareDataSourceWithZeroDate()
{
$zeroDate = '0000-00-00 00:00:00';
$item = ['test_data' => 'some_data', 'field_name' => $zeroDate];
$this->timezoneMock->expects($this->never())->method('date');

$result = $this->model->prepareDataSource(['data' => ['items' => [$item]]]);
$this->assertEquals($zeroDate, $result['data']['items'][0]['field_name']);
}
}

0 comments on commit 2f513bc

Please sign in to comment.