浏览代码

Set timezone to GMT for LDAP offline test to avoid DST issues with the selected date.

Rob Allen 12 年之前
父节点
当前提交
103ed9f5be
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      tests/Zend/Ldap/Node/OfflineTest.php

+ 5 - 0
tests/Zend/Ldap/Node/OfflineTest.php

@@ -273,6 +273,9 @@ class Zend_Ldap_Node_OfflineTest extends Zend_Ldap_TestCase
 
     public function testGetSetAndDeleteMethods()
     {
+        $timezone = date_default_timezone_get();
+        date_default_timezone_set('GMT');
+
         $node=$this->_createTestNode();
 
         $node->setAttribute('key', 'value1');
@@ -311,6 +314,8 @@ class Zend_Ldap_Node_OfflineTest extends Zend_Ldap_TestCase
         $this->assertEquals(0, count($node->getAttribute('userPassword')));
         $this->assertTrue($node->existsAttribute('userPassword', true));
         $this->assertFalse($node->existsAttribute('userPassword', false));
+
+        date_default_timezone_set($timezone);
     }
 
     public function testOverloading()