mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
new testcases
This commit is contained in:
parent
ba364121f1
commit
f1f6818c20
5 changed files with 72 additions and 34 deletions
|
@ -1,39 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
print "huhuhdsa";
|
|
||||||
|
|
||||||
$rpc = new com("class", true, "huh");
|
$rpc = new com("class");
|
||||||
$rpc2 = new com("class", true, "hehe", 1);
|
|
||||||
$rpc->call("blah");
|
|
||||||
$rpc->call("heh");
|
|
||||||
$rpc->call("blah");
|
|
||||||
com_call($rpc, 1, "1");
|
|
||||||
com_call($rpc, 1, "1");
|
|
||||||
$rpc->call("blah");
|
|
||||||
$rpc->call("blah");
|
|
||||||
$rpc->call("blah");
|
|
||||||
$rpc2->call("hehe");
|
|
||||||
$rpc2->call("hehe");
|
|
||||||
$rpc2->call("hehe");
|
|
||||||
$rpc2->call("hehe");
|
|
||||||
$rpc2->call("hehe");
|
|
||||||
com_call($rpc, "call", 1);
|
|
||||||
com_call($rpc, 1, "1");
|
|
||||||
com_call($rpc, "call", 1);
|
|
||||||
com_call($rpc2, "call", 1);
|
|
||||||
com_call($rpc2, "call", 1);
|
|
||||||
//$rpc->addref();
|
|
||||||
|
|
||||||
//$clone = $rpc->__clone();
|
/* class hirarchy test */
|
||||||
|
echo "is class .. " . (get_class($rpc) == "class" ? "passed" : "faiure");
|
||||||
|
echo "\n";
|
||||||
|
echo "is com .. " . (is_subclass_of($rpc, "com") ? "passed" : "failure");
|
||||||
|
echo "\n";
|
||||||
|
echo "is rpc .. " . (is_subclass_of($rpc, "rpc") ? "passed" : "failure");
|
||||||
|
|
||||||
//$rpc->prop = 1;
|
/* uncloneable */
|
||||||
//$a = $rpc->prop;
|
//$rpc->__clone(); // issues a fatal
|
||||||
|
|
||||||
//$a = &$rpc->prop;
|
|
||||||
|
|
||||||
//delete $rpc;
|
|
||||||
//delete $clone;
|
|
||||||
|
|
||||||
$heh = com_load("heh", 1);
|
|
||||||
$heh->knorp();
|
|
||||||
/*delete $heh;*/
|
|
||||||
?>
|
?>
|
20
ext/rpc/tests/test2.php
Normal file
20
ext/rpc/tests/test2.php
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
echo "hash test\n";
|
||||||
|
|
||||||
|
/* hash test */
|
||||||
|
$rpc1 = new com("hash", true, 1);
|
||||||
|
$rpc2 = new com("hash", false, 2);
|
||||||
|
$rpc3 = new com("hash", true, 3);
|
||||||
|
$rpc4 = com_load("hash", false, 4);
|
||||||
|
$rpc5 = com_load("hash", true, 5);
|
||||||
|
|
||||||
|
$rpc1->{3} = "hh";
|
||||||
|
com_set($rpc2, "hehe", 3);
|
||||||
|
|
||||||
|
$rpc1->call("blah");
|
||||||
|
$rpc2->call("blah");
|
||||||
|
$rpc3->call("blah");
|
||||||
|
$rpc4->call("heh");
|
||||||
|
$rpc5->call("blah");
|
||||||
|
?>
|
19
ext/rpc/tests/test3.php
Normal file
19
ext/rpc/tests/test3.php
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
echo "singleton test\n";
|
||||||
|
|
||||||
|
/* singleton test */
|
||||||
|
$rpc1 = new com("singleton", true, 1);
|
||||||
|
com_singleton($rpc1);
|
||||||
|
|
||||||
|
$rpc2 = new com("singleton", false, 2);
|
||||||
|
$rpc3 = new com("singleton", true, 3);
|
||||||
|
$rpc4 = new com("singleton", false, 4);
|
||||||
|
$rpc5 = new com("singleton", true, 5);
|
||||||
|
|
||||||
|
delete $rpc1;
|
||||||
|
delete $rpc2;
|
||||||
|
delete $rpc3;
|
||||||
|
delete $rpc4;
|
||||||
|
delete $rpc5;
|
||||||
|
?>
|
18
ext/rpc/tests/test4.php
Normal file
18
ext/rpc/tests/test4.php
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
echo "pooling test\n";
|
||||||
|
|
||||||
|
/* pooling test */
|
||||||
|
$rpc = new com("pooling", true, 1);
|
||||||
|
com_poolable($rpc);
|
||||||
|
delete $rpc;
|
||||||
|
|
||||||
|
$rpc = new com("pooling", true, 1);
|
||||||
|
delete $rpc;
|
||||||
|
|
||||||
|
$rpc = new com("pooling", true, 1);
|
||||||
|
delete $rpc;
|
||||||
|
|
||||||
|
$rpc = new com("pooling", true, 1);
|
||||||
|
delete $rpc;
|
||||||
|
?>
|
6
ext/rpc/tests/tests.php
Normal file
6
ext/rpc/tests/tests.php
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?php
|
||||||
|
//include_once "test1.php";
|
||||||
|
//include_once "test2.php";
|
||||||
|
//include_once "test3.php";
|
||||||
|
include_once "test4.php";
|
||||||
|
?>
|
Loading…
Add table
Add a link
Reference in a new issue