phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: xmlrpc testsuite.php,1.8,1.9


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: xmlrpc testsuite.php,1.8,1.9
Date: Sat, 09 Feb 2002 16:16:23 -0500

Update of /cvsroot/phpgroupware/xmlrpc
In directory subversions:/tmp/cvs-serv18668

Modified Files:
        testsuite.php 
Log Message:
add countTheEntities test



Index: testsuite.php
===================================================================
RCS file: /cvsroot/phpgroupware/xmlrpc/testsuite.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** testsuite.php       4 Jan 2002 01:29:53 -0000       1.8
--- testsuite.php       9 Feb 2002 21:16:21 -0000       1.9
***************
*** 108,120 ****
                        for($i=0; $i<$sz; $i++)
                        {
!                                $b=$v->arraymem($i);
!                                if ($b->scalarval())
!                                {
!                                        $got.="1";
!                                }
!                                else
!                                {
!                                        $got.="0";
!                                }
                        }
                        $this->assertEquals($answer, $got);
--- 108,120 ----
                        for($i=0; $i<$sz; $i++)
                        {
!                               $b=$v->arraymem($i);
!                               if($b->scalarval())
!                               {
!                                       $got.="1";
!                               }
!                               else
!                               {
!                                       $got.="0";
!                               }
                        }
                        $this->assertEquals($answer, $got);
***************
*** 139,142 ****
--- 139,164 ----
                        $this->assertEquals($sendstring, $v->scalarval());
                }
+ 
+               function countEntities()
+               {
+                       $sendstring = "h'fd>onc>>l>>rw&bpu>q>e<v&gxs<ytjzkami<";
+                       $f = 
CreateObject('phpgwapi.xmlrpcmsg','validator1.countTheEntities',array(
+                               CreateObject('phpgwapi.xmlrpcval',$sendstring, 
'string')
+                       ));
+                       $r = $this->client->send($f);
+                       $v = $r->value();
+ 
+                       $got = '';
+                       $expected = '37210';
+                       $expect_array = 
array('ctLeftAngleBrackets','ctRightAngleBrackets','ctAmpersands','ctApostrophes','ctQuotes');
+ 
+                       while(list(,$val) = each($expect_array))
+                       {
+                               $b = $v->structmem($val);
+                               $got .= $b->me['int'];
+                       }
+ 
+                       $this->assertEquals($expected, $got);
+               }
        }
  
***************
*** 245,248 ****
--- 267,271 ----
        $suite->addTest(new TestLocalhost('booleanTest'));
        $suite->addTest(new TestLocalhost('base64Test'));
+       $suite->addTest(new TestLocalhost('countEntities'));
        $suite->addTest(new TestInvalidHost('test404'));
        $suite->addTest(new TestFileCases('stringBug'));




reply via email to

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