From: Gunnar Wrobel
Date: Thu, 8 Apr 2010 13:10:24 +0000 (+0200) Subject: The list of internal attributes is just a list and not an association of attribute... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=0d1e771d22585db2acf253ce413e8ea85c8edfb6;p=horde.git The list of internal attributes is just a list and not an association of attribute names and corresponding class names. --- diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Base.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Base.php index 75bcebe8c..2e40cb60c 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Base.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Base.php @@ -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() ); } diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Hash.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Hash.php index f10235345..d3ef86097 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Hash.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Hash.php @@ -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() { diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Interface.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Interface.php index dd8b596c4..40c73d1d3 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Interface.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/Interface.php @@ -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(); diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Structure/Base.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Structure/Base.php index e4cf30f92..45e0360b8 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Structure/Base.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Structure/Base.php @@ -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) diff --git a/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Object/BaseTest.php b/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Object/BaseTest.php index 396ce56cd..d5cbda368 100644 --- a/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Object/BaseTest.php +++ b/framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Object/BaseTest.php @@ -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' ) ) );