phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] [18644] Updated IPC testcase for addressbook.


From: Johan Gunnarsson
Subject: [Phpgroupware-cvs] [18644] Updated IPC testcase for addressbook.
Date: Sun, 13 Jul 2008 22:48:42 +0000

Revision: 18644
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=18644
Author:   johang
Date:     2008-07-13 22:48:42 +0000 (Sun, 13 Jul 2008)

Log Message:
-----------
Updated IPC testcase for addressbook.

Modified Paths:
--------------
    trunk/addressbook/test/class.ipc_addressbook_test.inc.php

Modified: trunk/addressbook/test/class.ipc_addressbook_test.inc.php
===================================================================
--- trunk/addressbook/test/class.ipc_addressbook_test.inc.php   2008-07-13 
22:48:01 UTC (rev 18643)
+++ trunk/addressbook/test/class.ipc_addressbook_test.inc.php   2008-07-13 
22:48:42 UTC (rev 18644)
@@ -144,17 +144,18 @@
                /**
                 * @todo not working properly.
                 */
-               function test_replaceData()
+               function test_replaceData_replace()
                {
                        $id = $this->ipc->addData($this->sample_vcard, 
'text/x-vcard');
 
                        $this->assertTrue(is_string($this->ipc->getData($id,
                                'text/x-vcard')));
 
-                       // @todo test when replacing item that not already 
exists
+                       $new_id = $this->ipc->replaceData($id,
+                               $this->sample_vcard_changed, 'text/x-vcard');
 
-                       $this->assertTrue($this->ipc->replaceData($id,
-                               $this->sample_vcard_changed, 'text/x-vcard'));
+                       $this->assertTrue($new_id);
+                       $this->assertEqual($new_id, $id);
 
                        $data = $this->ipc->getData($id, 'text/x-vcard');
 
@@ -163,6 +164,28 @@
                        // @todo test more properties
                }
 
+               /**
+                * @todo not working properly.
+                */
+               function test_replaceData_add()
+               {
+                       $id = 100000;
+
+                       $this->assertFalse($this->ipc->existData($id));
+
+                       $new_id = $this->ipc->replaceData($id,
+                               $this->sample_vcard_changed, 'text/x-vcard');
+
+                       $this->assertTrue($new_id);
+                       $this->assertNotEqual($new_id, $id);
+
+                       $data = $this->ipc->getData($id, 'text/x-vcard');
+
+                       $this->assertTrue(strpos($data, 'Bubba'));
+
+                       // @todo test more properties
+               }
+
                function test_existData()
                {
                        $id = $this->ipc->addData($this->sample_vcard, 
'text/x-vcard');






reply via email to

[Prev in Thread] Current Thread [Next in Thread]