From a16446913a551babe019634d2a9b972c584708b1 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Thu, 3 May 2012 22:20:20 +0200 Subject: [PATCH] Added a failing test demonstrating the bug with DateTime and timezones PHP DateTime objects are mutable so changing the timezone when displaying it affects the following code whereas it does not occur for other supported formats. --- test/Twig/Tests/Fixtures/filters/date.test | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/test/Twig/Tests/Fixtures/filters/date.test b/test/Twig/Tests/Fixtures/filters/date.test index edfe596..4425746 100644 --- a/test/Twig/Tests/Fixtures/filters/date.test +++ b/test/Twig/Tests/Fixtures/filters/date.test @@ -4,9 +4,11 @@ {{ date1|date }} {{ date1|date('d/m/Y') }} {{ date1|date('d/m/Y H:i:s', 'Europe/Paris') }} +{{ date1|date('d/m/Y H:i:s') }} {{ date2|date }} {{ date2|date('d/m/Y') }} {{ date2|date('d/m/Y H:i:s', 'Europe/Paris') }} +{{ date2|date('d/m/Y H:i:s') }} {{ date3|date }} {{ date3|date('d/m/Y') }} {{ date4|date }} @@ -26,9 +28,11 @@ return array( October 4, 2010 13:45 04/10/2010 04/10/2010 15:45:00 +04/10/2010 13:45:00 October 4, 2010 13:45 04/10/2010 04/10/2010 15:45:00 +04/10/2010 13:45:00 October 4, 2010 13:45 04/10/2010 October 4, 2010 13:45 -- 1.7.2.5