소스 검색

Bug fix Ldap converter test to handle 5.2's serialised DateTime format

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24725 44c647ce-9c0f-0410-b52a-842ac1e357ba
rob 13 년 전
부모
커밋
8864e6cd62
1개의 변경된 파일15개의 추가작업 그리고 6개의 파일을 삭제
  1. 15 6
      tests/Zend/Ldap/ConverterTest.php

+ 15 - 6
tests/Zend/Ldap/ConverterTest.php

@@ -112,12 +112,21 @@ class Zend_Ldap_ConverterTest extends PHPUnit_Framework_TestCase
     }
 
     public function toLdapSerializeProvider(){
-        return array(
-            array('N;', null),
-            array('i:1;', 1),
-            array('O:8:"DateTime":3:{s:4:"date";s:19:"1970-01-01 00:00:00";s:13:"timezone_type";i:1;s:8:"timezone";s:6:"+00:00";}', new DateTime('@0')),
-            array('a:3:{i:0;s:4:"test";i:1;i:1;s:3:"foo";s:3:"bar";}', array('test',1,'foo'=>'bar')),
-        );
+        if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+            return array(
+                array('N;', null),
+                array('i:1;', 1),
+                array('O:8:"DateTime":0:{}', new DateTime('@0')),
+                array('a:3:{i:0;s:4:"test";i:1;i:1;s:3:"foo";s:3:"bar";}', array('test',1,'foo'=>'bar')),
+            );
+        } else {
+            return array(
+                array('N;', null),
+                array('i:1;', 1),
+                array('O:8:"DateTime":3:{s:4:"date";s:19:"1970-01-01 00:00:00";s:13:"timezone_type";i:1;s:8:"timezone";s:6:"+00:00";}', new DateTime('@0')),
+                array('a:3:{i:0;s:4:"test";i:1;i:1;s:3:"foo";s:3:"bar";}', array('test',1,'foo'=>'bar')),
+            );
+        }
     }
 
     /**