Fix more errors when running tests in strict mode.
authorGunnar Wrobel <p@rdus.de>
Fri, 2 Oct 2009 18:47:32 +0000 (20:47 +0200)
committerGunnar Wrobel <p@rdus.de>
Fri, 2 Oct 2009 18:47:32 +0000 (20:47 +0200)
framework/Kolab_Server/lib/Horde/Kolab/Server/Ldap.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Object.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Kolabgroupofnames.php
framework/Kolab_Server/test/Horde/Kolab/Server/AllTests.php
framework/Kolab_Server/test/Horde/Kolab/Server/UserTest.php

index c933c54..61aad37 100644 (file)
@@ -352,7 +352,7 @@ class Horde_Kolab_Server_Ldap extends Horde_Kolab_Server
         if (isset($params['attributes'])) {
             $options['attributes'] = $params['attributes'];
         } else {
-            $options['attributes'] = $vars['_supported_attributes'];
+            $options['attributes'] = $this->getAttributes($type);
         }
 
         $data = $this->search($filter, $options, $base);
index fa94c30..c2a5a71 100644 (file)
@@ -385,7 +385,9 @@ class Horde_Kolab_Server_Object
     protected function _get($attr, $single = true)
     {
         if (isset($this->_cache[$attr])) {
-            if ($single && is_array($this->_cache[$attr])) {
+            if (empty($this->_cache[$attr])) {
+                return false;
+            } else if ($single && is_array($this->_cache[$attr])) {
                 return $this->_cache[$attr][0];
             } else {
                 return $this->_cache[$attr];
index 27a25e9..1fd13d4 100644 (file)
@@ -91,7 +91,7 @@ class Horde_Kolab_Server_Object_Kolabgroupofnames extends Horde_Kolab_Server_Obj
         case self::ATTRIBUTE_VISIBILITY:
             //FIXME: This needs structural knowledge and should be in a
             //structural class.
-            return strpos($this->_uid, 'cn=internal') === false;
+            return strpos($this->uid, 'cn=internal') === false;
         default:
             return parent::derive($attr);
         }
index 5e49ab1..d5213c2 100644 (file)
@@ -61,7 +61,7 @@ class Horde_Kolab_Server_AllTests
         // FIXME: This does not work yet, as we still have a number of
         //        static methods in basic Horde libraries that are not
         //        declared as such.
-        //error_reporting(E_ALL | E_STRICT);
+        error_reporting(E_ALL | E_STRICT);
 
         $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Kolab_Server');
 
index dc610d0..d23c7fd 100644 (file)
@@ -102,9 +102,6 @@ class Horde_Kolab_Server_UserTest extends Horde_Kolab_Server_Scenario
 
         $user = $this->server->fetch('cn=Gunnar Wrobel,dc=example,dc=org');
         $attr = $user->get(Horde_Kolab_Server_Object_Kolab_User::ATTRIBUTE_FREEBUSYHOST);
-        if (is_a($attr, 'PEAR_Error')) {
-            $this->assertEquals('', $attr->getMessage());
-        }
         $this->assertEquals('https://fb.example.org/freebusy', $attr);
 
         $imap = $user->getServer('freebusy');