[Phpfreechat-svn] SF.net SVN: phpfreechat: [903] trunk/testcase/container_generic.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-12-19 22:32:59
|
Revision: 903 http://svn.sourceforge.net/phpfreechat/?rev=903&view=rev Author: kerphi Date: 2006-12-19 14:32:45 -0800 (Tue, 19 Dec 2006) Log Message: ----------- add a testcase on rmMeta Modified Paths: -------------- trunk/testcase/container_generic.php Modified: trunk/testcase/container_generic.php =================================================================== --- trunk/testcase/container_generic.php 2006-12-19 17:56:01 UTC (rev 902) +++ trunk/testcase/container_generic.php 2006-12-19 22:32:45 UTC (rev 903) @@ -79,9 +79,10 @@ // on the channel $this->ct->createNick($chan, $nick, $nickid); - $this->ct->removeNick($chan, $nickid); + + $this->ct->removeNick($chan, $nickid); $isonline = ($this->ct->isNickOnline($chan, $nickid) >= 0); - $this->assertFalse($isonline, "nickname shouldn't be online on the channel"); + $this->assertFalse($isonline, "nickname shouldn't be online on the channel"); $isonline2 = ($this->ct->isNickOnline(NULL, $nickid) >= 0); $this->assertTrue($isonline2, "nickname should be online on the server"); @@ -89,7 +90,7 @@ $isonline = ($this->ct->isNickOnline(NULL, $nickid) >= 0); $this->assertFalse($isonline, "nickname shouldn't be online on the server"); } - + function test_getNickId_Generic() { $c =& $this->c; @@ -377,6 +378,33 @@ $this->assertEquals($subgroup1, $ret["value"][0], "the subgroup name is wrong"); $this->assertEquals($subgroup2, $ret["value"][1], "the subgroup name is wrong"); } + + function test_rmMeta_Generic() + { + $c =& $this->c; + $ct =& $this->ct; + + $prefix = __FUNCTION__; + $group = $prefix."_nickid-to-channelid"; + $subgroup1 = $prefix."_nickid1"; + $subgroup2 = $prefix."_nickid2"; + $leaf1 = $prefix."_channelid1"; + $leaf2 = $prefix."_channelid2"; + $ct->setMeta($group, $subgroup1, $leaf1); + $ct->setMeta($group, $subgroup1, $leaf2); + + $ret = $ct->getMeta($group,$subgroup1); + $ret = $ct->getMeta($group,$subgroup1,$leaf1); + + $ct->rmMeta($group, $subgroup1, $leaf1); + + $ret = $ct->getMeta($group,$subgroup1); + $this->assertEquals(1, count($ret["value"]), "number of leaf is wrong"); + $ret = $ct->getMeta($group,$subgroup1,$leaf1); + $this->assertEquals(0, count($ret["value"]), "leaf should not exists"); + } + + } ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |