The list of internal attributes is just a list and not an association of attribute...
authorGunnar Wrobel <p@rdus.de>
Thu, 8 Apr 2010 13:10:24 +0000 (15:10 +0200)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 8 Apr 2010 19:27:14 +0000 (13:27 -0600)
framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Base.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Hash.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Interface.php
framework/Kolab_Server/lib/Horde/Kolab/Server/Structure/Base.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Object/BaseTest.php

index 75bcebe..2e40cb6 100644 (file)
@@ -87,9 +87,7 @@ implements Horde_Kolab_Server_Object_Interface
     /**
      * Get the internal attributes supported by this object.
      *
-     * @return array The internal attributes supported by this object. This is
-     * an association of internal attribute names an the correspodning attribute
-     * class names.
+     * @return array The internal attributes supported by this object.
      */
     public function getInternalAttributes()
     {
@@ -119,7 +117,7 @@ implements Horde_Kolab_Server_Object_Interface
     public function readInternal()
     {
         return $this->_composite->server->readAttributes(
-            $this->getGuid(), array_keys($this->getInternalAttributes())
+            $this->getGuid(), $this->getInternalAttributes()
         );
     }
 
index f102353..d3ef860 100644 (file)
@@ -71,8 +71,7 @@ implements Horde_Kolab_Server_Object_Interface
     /**
      * Get the internal attributes supported by this object.
      *
-     * @return array The internal attributes supported by this object. This is
-     * an association of attribute names and attribute handler class names.
+     * @return array The internal attributes supported by this object.
      */
     public function getInternalAttributes()
     {
index dd8b596..40c73d1 100644 (file)
@@ -45,9 +45,7 @@ interface Horde_Kolab_Server_Object_Interface
     /**
      * Get the internal attributes supported by this object.
      *
-     * @return array The internal attributes supported by this object. This is
-     * an association of internal attribute names an the correspodning attribute
-     * class names.
+     * @return array The internal attributes supported by this object.
      */
     public function getInternalAttributes();
 
index e4cf30f..45e0360 100644 (file)
@@ -157,8 +157,9 @@ implements Horde_Kolab_Server_Structure_Interface
 
     public function getInternalAttributes($class)
     {
-        $external = $this->getExternalAttributes($class);
-        return $this->mapExternalToInternalAttributes($external);
+        return $this->mapExternalToInternalAttributes(
+            $this->getExternalAttributes($class)
+        );
     }
 
     public function getInternalAttributesForExternal($class, $external)
index 396ce56..d5cbda3 100644 (file)
@@ -86,9 +86,9 @@ class Horde_Kolab_Server_Class_Server_Object_BaseTest extends Horde_Kolab_Server
         $composite->structure->expects($this->once())
             ->method('getInternalAttributes')
             ->with($this->isInstanceOf('Horde_Kolab_Server_Object_Interface'))
-            ->will($this->returnValue(array('internal' => 'Internal')));
+            ->will($this->returnValue(array('internal')));
         $object = new Object_Mock($composite, 'guid');
-        $this->assertEquals(array('internal' => 'Internal'), $object->getInternalAttributes());
+        $this->assertEquals(array('internal'), $object->getInternalAttributes());
     }
 
     public function testMethodExistsHasResultBooleanFalseIfTheGuidIsNotSpecified()
@@ -104,7 +104,7 @@ class Horde_Kolab_Server_Class_Server_Object_BaseTest extends Horde_Kolab_Server
         $composite->structure->expects($this->once())
             ->method('getInternalAttributes')
             ->with($this->isInstanceOf('Horde_Kolab_Server_Object_Interface'))
-            ->will($this->returnValue(array('internal' => 'Internal')));
+            ->will($this->returnValue(array('internal')));
         $composite->server->expects($this->once())
             ->method('readAttributes')
             ->with('guid', array('internal'))
@@ -119,7 +119,7 @@ class Horde_Kolab_Server_Class_Server_Object_BaseTest extends Horde_Kolab_Server
         $composite->structure->expects($this->once())
             ->method('getInternalAttributes')
             ->with($this->isInstanceOf('Horde_Kolab_Server_Object_Interface'))
-            ->will($this->returnValue(array('internal' => 'Internal')));
+            ->will($this->returnValue(array('internal')));
         $composite->server->expects($this->once())
             ->method('readAttributes')
             ->with('guid', array('internal'))
@@ -134,7 +134,7 @@ class Horde_Kolab_Server_Class_Server_Object_BaseTest extends Horde_Kolab_Server
         $composite->structure->expects($this->once())
             ->method('getInternalAttributes')
             ->with($this->isInstanceOf('Horde_Kolab_Server_Object_Interface'))
-            ->will($this->returnValue(array('internal' => 'Internal')));
+            ->will($this->returnValue(array('internal')));
         $composite->server->expects($this->once())
             ->method('readAttributes')
             ->with('guid', array('internal'))
@@ -151,7 +151,7 @@ class Horde_Kolab_Server_Class_Server_Object_BaseTest extends Horde_Kolab_Server
         $composite->structure->expects($this->exactly(1))
             ->method('getInternalAttributes')
             ->with($this->isInstanceOf('Horde_Kolab_Server_Object_Interface'))
-            ->will($this->returnValue(array('internal' => 'Internal')));
+            ->will($this->returnValue(array('internal')));
         $composite->server->expects($this->once())
             ->method('readAttributes')
             ->with('guid', array('internal'))
@@ -168,7 +168,7 @@ class Horde_Kolab_Server_Class_Server_Object_BaseTest extends Horde_Kolab_Server
         $composite->structure->expects($this->once())
             ->method('getInternalAttributes')
             ->with($this->isInstanceOf('Horde_Kolab_Server_Object_Interface'))
-            ->will($this->returnValue(array('internal' => 'Internal')));
+            ->will($this->returnValue(array('internal')));
         $object = new Object_Mock($composite, 'guid');
         try {
             $object->getInternal(array('test'));
@@ -186,7 +186,7 @@ class Horde_Kolab_Server_Class_Server_Object_BaseTest extends Horde_Kolab_Server
             ->with($this->isInstanceOf('Horde_Kolab_Server_Object_Interface'))
             ->will(
                 $this->returnValue(
-                    array('internal' => 'Internal', 'test' => 'Test')
+                    array('internal', 'test')
                 )
             );
         $composite->server->expects($this->once())
@@ -262,8 +262,7 @@ class Horde_Kolab_Server_Class_Server_Object_BaseTest extends Horde_Kolab_Server
             ->will(
                 $this->returnValue(
                     array(
-                        'objectClass' =>
-                        'Horde_Kolab_Server_Object_Attribute_Objectclass'
+                        'objectClass'
                     )
                 )
             );