Avoid testsuite failure on php 5.2 with DateTimes
authorgggeek <giunta.gaetano@gmail.com>
Sun, 7 Dec 2014 21:08:14 +0000 (21:08 +0000)
committergggeek <giunta.gaetano@gmail.com>
Sun, 7 Dec 2014 21:08:14 +0000 (21:08 +0000)
test/testsuite.php

index 0164c66..3b33f80 100644 (file)
@@ -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());
+            }
         }
     }