--- /dev/null
+--TEST--
+ReflectionParameter::export()
+--CREDITS--
+Stefan Koopmanschap <stefan@stefankoopmanschap.nl>
+--FILE--
+<?php
+function ReflectionParameterTest($test, $test2 = null) {
+ echo $test;
+}
+$reflect = new ReflectionFunction('ReflectionParameterTest');
+foreach($reflect->getParameters() as $key => $value) {
+ echo ReflectionParameter::export('ReflectionParameterTest', $key);
+}
+?>
+==DONE==
+--EXPECT--
+Parameter #0 [ <required> $test ]
+Parameter #1 [ <optional> $test2 = NULL ]
+==DONE==
--- /dev/null
+--TEST--
+ReflectionParameter::export() without parameters
+--CREDITS--
+Stefan Koopmanschap <stefan@stefankoopmanschap.nl>
+--FILE--
+<?php
+function ReflectionParameterTest($test, $test2 = null) {
+ echo $test;
+}
+$reflect = new ReflectionFunction('ReflectionParameterTest');
+foreach($reflect->getParameters() as $key => $value) {
+ ReflectionParameter::export();
+}
+?>
+==DONE==
+--EXPECTF--
+
+Warning: ReflectionParameter::export() expects at least 2 parameters, 0 given in %s.php on line %d
+
+Warning: ReflectionParameter::export() expects at least 2 parameters, 0 given in %s.php on line %d
+==DONE==
--- /dev/null
+--TEST--
+ReflectionParameter::export() with incorrect first parameter
+--CREDITS--
+Stefan Koopmanschap <stefan@stefankoopmanschap.nl>
+--FILE--
+<?php
+function ReflectionParameterTest($test, $test2 = null) {
+ echo $test;
+}
+$reflect = new ReflectionFunction('ReflectionParameterTest');
+$params = $reflect->getParameters();
+foreach($params as $key => $value) {
+ ReflectionParameter::export($reflect, $key);
+}
+?>
+--EXPECTF--
+
+Fatal error: Uncaught exception 'ReflectionException' with message 'The parameter class is expected to be either a string or an array(class, method)' in %s.php:%d
+Stack trace:
+#0 [internal function]: ReflectionParameter->__construct(Object(ReflectionFunction), 0)
+#1 %s.php(%d): ReflectionParameter::export(Object(ReflectionFunction), 0)
+#2 {main}
+ thrown in %s.php on line %d
--- /dev/null
+--TEST--
+ReflectionParameter::export() with incorrect second parameter
+--CREDITS--
+Stefan Koopmanschap <stefan@stefankoopmanschap.nl>
+--FILE--
+<?php
+function ReflectionParameterTest($test, $test2 = null) {
+ echo $test;
+}
+$reflect = new ReflectionFunction('ReflectionParameterTest');
+$params = $reflect->getParameters();
+foreach($params as $key => $value) {
+ ReflectionParameter::export('ReflectionParameterTest', 'incorrect_parameter');
+}
+--EXPECTF--
+
+Fatal error: Uncaught exception 'ReflectionException' with message 'The parameter specified by its name could not be found' in %s.php:%d
+Stack trace:
+#0 [internal function]: ReflectionParameter->__construct('ReflectionParam...', 'incorrect_param...')
+#1 %s.php(%d): ReflectionParameter::export('ReflectionParam...', 'incorrect_param...')
+#2 {main}
+ thrown in %s.php on line %d
--- /dev/null
+--TEST--
+ReflectionParameter::getDeclaringFunction()
+--CREDITS--
+Stefan Koopmanschap <stefan@stefankoopmanschap.nl>
+#testfest roosendaal on 2008-05-10
+--FILE--
+<?php
+function ReflectionParameterTest($test, $test2 = null) {
+ echo $test;
+}
+$reflect = new ReflectionFunction('ReflectionParameterTest');
+$params = $reflect->getParameters();
+foreach($params as $key => $value) {
+ echo $value->getDeclaringFunction() . "\n";
+}
+?>
+==DONE==
+--EXPECTF--
+Function [ <user> function ReflectionParameterTest ] {
+ @@ %s.php %d - %d
+
+ - Parameters [2] {
+ Parameter #0 [ <required> $test ]
+ Parameter #1 [ <optional> $test2 = NULL ]
+ }
+}
+
+Function [ <user> function ReflectionParameterTest ] {
+ @@ %s.php %d - %d
+
+ - Parameters [2] {
+ Parameter #0 [ <required> $test ]
+ Parameter #1 [ <optional> $test2 = NULL ]
+ }
+}
+
+==DONE==
--- /dev/null
+--TEST--
+ReflectionParameter::getPosition()
+--CREDITS--
+Stefan Koopmanschap <stefan@stefankoopmanschap.nl>
+#testfest roosendaal on 2008-05-10
+--FILE--
+<?php
+function ReflectionParameterTest($test, $test2 = null) {
+ echo $test;
+}
+$reflect = new ReflectionFunction('ReflectionParameterTest');
+$params = $reflect->getParameters();
+foreach($params as $key => $value) {
+ var_dump($value->getPosition());
+}
+?>
+==DONE==
+--EXPECT--
+int(0)
+int(1)
+==DONE==
--- /dev/null
+--TEST--
+ReflectionParameter::__toString()
+--CREDITS--
+Stefan Koopmanschap <stefan@stefankoopmanschap.nl>
+--FILE--
+<?php
+function ReflectionParameterTest($test, $test2 = null) {
+ echo $test;
+}
+$reflect = new ReflectionFunction('ReflectionParameterTest');
+$params = $reflect->getParameters();
+foreach($params as $key => $value) {
+ echo $value->__toString() . "\n";
+}
+?>
+==DONE==
+--EXPECT--
+Parameter #0 [ <required> $test ]
+Parameter #1 [ <optional> $test2 = NULL ]
+==DONE==