2
0
Преглед на файлове

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)
     {
-        $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)