瀏覽代碼

Update Zend_Ldap_Attribute unit tests to handle the situation where the unit tests are run from a computer with a local timezone of +0000

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24721 44c647ce-9c0f-0410-b52a-842ac1e357ba
rob 13 年之前
父節點
當前提交
dda3eab437
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      tests/Zend/Ldap/AttributeTest.php

+ 10 - 1
tests/Zend/Ldap/AttributeTest.php

@@ -37,7 +37,16 @@ class Zend_Ldap_AttributeTest extends PHPUnit_Framework_TestCase
 {
 {
     protected function _assertLocalDateTimeString($timestamp, $value)
     protected function _assertLocalDateTimeString($timestamp, $value)
     {
     {
-        $this->assertEquals(date('YmdHisO', $timestamp), $value);
+        $tsValue = date('YmdHisO', $timestamp);
+
+        if(date('O', strtotime('20120101'))) {
+            // Local timezone is +0000 when DST is off. Zend_Ldap converts
+            // +0000 to "Z" (see Zend_Ldap_Converter:toLdapDateTime()), so
+            // take account of that here
+            $tsValue = str_replace('+0000', 'Z', $tsValue);
+        }
+
+        $this->assertEquals($tsValue, $value);
     }
     }
 
 
     protected function _assertUtcDateTimeString($localTimestamp, $value)
     protected function _assertUtcDateTimeString($localTimestamp, $value)