From: Fabien Potencier Date: Fri, 8 Feb 2013 19:37:43 +0000 (+0100) Subject: added some missing tests X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=fa0d1eec434d53940c3e2ebe28b1a766e0a431ca;p=konrad%2Ftwig.git added some missing tests --- diff --git a/test/Twig/Tests/Fixtures/functions/date.test b/test/Twig/Tests/Fixtures/functions/date.test index caeee7a..a4c9716 100644 --- a/test/Twig/Tests/Fixtures/functions/date.test +++ b/test/Twig/Tests/Fixtures/functions/date.test @@ -7,14 +7,15 @@ {{ date(date2) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} {{ date(date3) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} {{ date(date4) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} +{{ date(date5) == date('1964-01-02 03:04') ? 'OK' : 'KO' }} --DATA-- date_default_timezone_set('UTC'); return array( 'date1' => mktime(13, 45, 0, 10, 4, 2010), 'date2' => new DateTime('2010-10-04 13:45'), 'date3' => '2010-10-04 13:45', - 'date4' => 1286199900, - 'date5' => -86410, + 'date4' => 1286199900, // DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT + 'date5' => -189291360, // DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new DateTimeZone('UTC'))->getTimestamp(), ) --EXPECT-- OK @@ -23,3 +24,4 @@ OK OK OK OK +OK