]> granicus.if.org Git - php/commitdiff
This commit was manufactured by cvs2svn to create branch 'PHP_5_0'.
authorSVN Migration <svn@php.net>
Tue, 3 Aug 2004 04:36:01 +0000 (04:36 +0000)
committerSVN Migration <svn@php.net>
Tue, 3 Aug 2004 04:36:01 +0000 (04:36 +0000)
ext/reflection/tests/parameters_001.phpt [new file with mode: 0755]
pear/go-pear.bat [new file with mode: 0644]

diff --git a/ext/reflection/tests/parameters_001.phpt b/ext/reflection/tests/parameters_001.phpt
new file mode 100755 (executable)
index 0000000..7099446
--- /dev/null
@@ -0,0 +1,38 @@
+--TEST--
+Check for parameter being optional
+--FILE--
+<?php
+
+class Test {
+       function func($x, $y = NULL){
+       }
+}
+
+
+$f = new ReflectionMethod('Test', 'func');
+var_dump($f->getNumberOfParameters());
+var_dump($f->getNumberOfRequiredParameters());
+
+$p = new ReflectionParameter(array('Test', 'func'), 'x');
+var_dump($p->isOptional());
+
+$p = new ReflectionParameter(array('Test', 'func'), 'y');
+var_dump($p->isOptional());
+
+try {
+       $p = new ReflectionParameter(array('Test', 'func'), 'z');
+       var_dump($p->isOptional());
+}
+catch (Exception $e) {
+       var_dump($e->getMessage());
+}
+
+?>
+===DONE===
+--EXPECT--
+int(2)
+int(1)
+bool(false)
+bool(true)
+string(54) "The parameter specified by its name could not be found"
+===DONE===
diff --git a/pear/go-pear.bat b/pear/go-pear.bat
new file mode 100644 (file)
index 0000000..7f369d9
--- /dev/null
@@ -0,0 +1,4 @@
+@ECHO OFF\r
+set PHP_BIN=php.exe\r
+%PHP_BIN% -n -d output_buffering=0 PEAR\go-pear.php\r
+pause\r