diff --git a/framework/Kolab_Storage/test/Horde/Kolab/Storage/Unit/Data/Query/History/BaseTest.php b/framework/Kolab_Storage/test/Horde/Kolab/Storage/Unit/Data/Query/History/BaseTest.php index bfceb0edcdb..1152255c1ae 100644 --- a/framework/Kolab_Storage/test/Horde/Kolab/Storage/Unit/Data/Query/History/BaseTest.php +++ b/framework/Kolab_Storage/test/Horde/Kolab/Storage/Unit/Data/Query/History/BaseTest.php @@ -7,6 +7,7 @@ * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel + * @author Thomas Jarosch * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ @@ -22,6 +23,7 @@ * @category Kolab * @package Kolab_Storage * @author Gunnar Wrobel + * @author Thomas Jarosch * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @link http://pear.horde.org/index.php?package=Kolab_Storage */ @@ -35,7 +37,7 @@ public function testSynchronize() 1, count( $this->history->getHistory( - '20080626155721.771268tms63o0rs4@devmail.example.com' + 'mnemo:internal_id:ABC1234' ) ) ); @@ -46,8 +48,8 @@ public function testAdded() $this->_getDataQuery(); $this->assertEquals( array( - '20080626155721.771268tms63o0rs4@devmail.example.com' => 1, - '20090731103253.11391snjudt9zgpw@webmail.example.com' => 2 + 'mnemo:internal_id:ABC1234' => 1, + 'mnemo:internal_id:DEF5678' => 2 ), $this->history->getByTimestamp( '>', @@ -65,11 +67,13 @@ public function testAdded() public function testSingleAdd() { + // TODO: What is the purpose of this test exactly? + // It looks pretty identical to the test above. $this->_getDataQuery()->synchronize(); $this->assertEquals( array( - '20080626155721.771268tms63o0rs4@devmail.example.com' => 1, - '20090731103253.11391snjudt9zgpw@webmail.example.com' => 2 + 'mnemo:internal_id:ABC1234' => 1, + 'mnemo:internal_id:DEF5678' => 2 ), $this->history->getByTimestamp( '>', @@ -88,11 +92,12 @@ public function testSingleAdd() public function testModify() { $data = $this->_getData(); - $o = $data->getObject('20090731103253.11391snjudt9zgpw@webmail.example.com'); + $o = $data->getObject('DEF5678'); $data->modify($o); + $this->assertEquals( array( - '20090731103253.11391snjudt9zgpw@webmail.example.com' => 3 + 'mnemo:internal_id:DEF5678' => 3 ), $this->history->getByTimestamp( '>', @@ -111,10 +116,11 @@ public function testModify() public function testDelete() { $data = $this->_getData(); - $data->delete('20090731103253.11391snjudt9zgpw@webmail.example.com'); + $data->delete('ABC1234'); + $this->assertEquals( array( - '20090731103253.11391snjudt9zgpw@webmail.example.com' => 3 + 'mnemo:internal_id:ABC1234' => 3 ), $this->history->getByTimestamp( '>', @@ -148,16 +154,32 @@ private function _getFolder() $this->getDataAccount( array( 'user/test/History' => array( - 't' => 'h-prefs.default', + 'a' => array( + '/shared/vendor/kolab/folder-type' => 'note.default', + '/shared/vendor/horde/share-params' => base64_encode(serialize(array('share_name' => 'internal_id'))) + ), 'm' => array( - 1 => array('file' => __DIR__ . '/../../../../fixtures/preferences.1'), - 2 => array('file' => __DIR__ . '/../../../../fixtures/preferences.2'), + 1 => array('file' => __DIR__ . '/../../../../fixtures/note.eml'), + 2 => array('file' => __DIR__ . '/../../../../fixtures/note2.eml'), ), ) ) ), array( 'queryset' => array('data' => array('queryset' => 'horde')), + 'queries' => array( + 'list' => array( + Horde_Kolab_Storage_List_Tools::QUERY_BASE => array( + 'cache' => false + ), + Horde_Kolab_Storage_List_Tools::QUERY_ACL => array( + 'cache' => false + ), + Horde_Kolab_Storage_List_Tools::QUERY_SHARE => array( + 'cache' => false + ), + ) + ), 'history' => $this->history ) ); diff --git a/framework/Kolab_Storage/test/Horde/Kolab/Storage/fixtures/note2.eml b/framework/Kolab_Storage/test/Horde/Kolab/Storage/fixtures/note2.eml new file mode 100644 index 00000000000..166ffcfe18e --- /dev/null +++ b/framework/Kolab_Storage/test/Horde/Kolab/Storage/fixtures/note2.eml @@ -0,0 +1,42 @@ +From: user +To: user +Date: Tue, 11 Sep 2012 09:06:04 +0200 +Subject: DEF5678 +User-Agent: Horde::Kolab::Storage v@version@ +MIME-Version: 1.0 +X-Kolab-Type: application/x-vnd.kolab.note +Content-Type: multipart/mixed; name="Kolab Groupware Data"; + boundary="=_23WLX7vgjhlQTuLb6j00EAA" +Content-Disposition: attachment; filename="Kolab Groupware Data" + +This message is in MIME format. + +--=_23WLX7vgjhlQTuLb6j00EAA +Content-Type: text/plain; name="Kolab Groupware Information"; charset=utf-8 +Content-Disposition: inline; filename="Kolab Groupware Information" + +This is a Kolab Groupware object. To view this object you will need an email +client that understands the Kolab Groupware format. For a list of such email +clients please visit http://www.kolab.org/content/kolab-clients +--=_23WLX7vgjhlQTuLb6j00EAA +Content-Type: application/x-vnd.kolab.note; name=kolab.xml +Content-Disposition: inline; x-kolab-type=xml; filename=kolab.xml +Content-Transfer-Encoding: quoted-printable + + + + DEF5678 + + + 2012-09-11T09:06:04Z + 2012-09-11T07:06:04Z + public + Horde_Kolab_Format_Xml-@version@ (api version: 2) + TEST2 + other client + #000000 + #ffff00 + + +--=_23WLX7vgjhlQTuLb6j00EAA--