Revision: 18639 http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=18639 Author: johang Date: 2008-07-04 16:41:50 +0000 (Fri, 04 Jul 2008)
Log Message: ----------- The the lastmod stuff too. 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-04 16:19:52 UTC (rev 18638) +++ trunk/addressbook/test/class.ipc_addressbook_test.inc.php 2008-07-04 16:41:50 UTC (rev 18639) @@ -72,17 +72,25 @@ function setup() { + foreach($this->ipc->getIdlist() as $d) + { + $this->ipc->removeData($d); + } } function teardown() { + foreach($this->ipc->getIdlist() as $d) + { + $this->ipc->removeData($d); + } } function test_addData_and_getData() { $id = $this->ipc->addData($this->sample_vcard, 'text/x-vcard'); - $this->assertFalse($id === FALSE); - + $this->assertTrue($id); + $data = $this->ipc->getData($id, 'text/x-vcard'); $this->assertTrue(is_string($data)); } @@ -101,6 +109,22 @@ array_merge($id_list_before, array($a, $b, $c))); } + function test_getIdList_with_lastmod() + { + $now = time(); + + $this->assertEqual($this->ipc->getIdlist($now + 10), array()); + $this->assertEqual($this->ipc->getIdlist($now - 10), array()); + + $a = $this->ipc->addData($this->sample_vcard, 'text/x-vcard'); + + $id_list_plus10 = $this->ipc->getIdlist($now + 10); + $id_list_minus10 = $this->ipc->getIdlist($now - 10); + + $this->assertEqual($id_list_minus10, array($a)); + $this->assertEqual($id_list_plus10, array()); + } + function test_removeData() { $id = $this->ipc->addData($this->sample_vcard, 'text/x-vcard'); _______________________________________________ phpGroupWare-cvs mailing list phpGroupWare-cvs@gnu.org http://lists.gnu.org/mailman/listinfo/phpgroupware-cvs