From 9107200d73d380c154d92ebb9d5452f3a3c8169d Mon Sep 17 00:00:00 2001 From: gggeek Date: Sun, 7 Dec 2014 21:08:14 +0000 Subject: [PATCH] Avoid testsuite failure on php 5.2 with DateTimes --- test/testsuite.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/testsuite.php b/test/testsuite.php index 0164c66..3b33f80 100644 --- a/test/testsuite.php +++ b/test/testsuite.php @@ -228,8 +228,12 @@ And turned it into nylon'; if (class_exists('DateTime')) { $datetime = new DateTime(); - $t3 = new xmlrpcval($datetime->setTimestamp($time), 'dateTime.iso8601'); - $this->assertEquals($t1->serialize(), $t3->serialize()); + // skip this test for php 5.2. It is a bit harder there to build a DateTime from unix timestamp with proper TZ info + if(is_callable(array($datetime,'setTimestamp'))) + { + $t3 = new xmlrpcval($datetime->setTimestamp($time), 'dateTime.iso8601'); + $this->assertEquals($t1->serialize(), $t3->serialize()); + } } } -- 2.43.0