From 99ca6ed10001a7193582bca33613b075b986a5b1 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 May 2014 02:51:36 +0200 Subject: [PATCH] zendframework/zf2#6058 - Timestamp tests should not use hardcoded (hard to read) timestamps --- test/Filter/TimestampTest.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/Filter/TimestampTest.php b/test/Filter/TimestampTest.php index e5136935..dbb81afe 100644 --- a/test/Filter/TimestampTest.php +++ b/test/Filter/TimestampTest.php @@ -119,6 +119,9 @@ public function testIgnoresMessagesWithoutTimestamp(array $message) public function dateTimeDataProvider() { + $march2 = new DateTime('2014-03-02'); + $march3 = new DateTime('2014-03-03'); + return array( array(new DateTime('2014-03-03'), new DateTime('2014-03-03'), '>=', true), array(new DateTime('2014-10-10'), new DateTime('2014-03-03'),'>=', true), @@ -127,10 +130,10 @@ public function dateTimeDataProvider() array(new DateTime('2014-03-03'), new DateTime('2014-03-03'), '==', true), array(new DateTime('2014-02-02'), new DateTime('2014-03-03'), '<', true), array(new DateTime('2014-03-03'), new DateTime('2014-03-03'), 'lt', false), - array(1399140540, new DateTime('2014-03-03'), 'lt', false), - array(1399140480, new DateTime('2014-03-03'), 'lt', true), - array('1399140540', new DateTime('2014-03-03'), 'lt', false), - array('1399140480', new DateTime('2014-03-03'), 'lt', true), + array($march3->getTimestamp(), new DateTime('2014-03-03'), 'lt', false), + array($march2->getTimestamp(), new DateTime('2014-03-03'), 'lt', true), + array((string) $march3->getTimestamp(), new DateTime('2014-03-03'), 'lt', false), + array((string) $march2->getTimestamp(), new DateTime('2014-03-03'), 'lt', true), ); }