From 92a684f8bf797a850dc10b1023c395aa14920600 Mon Sep 17 00:00:00 2001 From: Tom Van Looy Date: Sat, 13 Oct 2018 09:03:11 +0200 Subject: [PATCH] Reflection info test --- tests/reflection.phpt | 53 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 tests/reflection.phpt diff --git a/tests/reflection.phpt b/tests/reflection.phpt new file mode 100644 index 0000000..0f36752 --- /dev/null +++ b/tests/reflection.phpt @@ -0,0 +1,53 @@ +--TEST-- +test reflection of pledge() and unveil() functions +--FILE-- +getParameters(); +var_dump( + (string) $r->getReturnType(), + $p, + (string) $p[0]->getType(), + (string) $p[1]->getType() +); + +$r = new ReflectionFunction('unveil'); +$p = $r->getParameters(); +var_dump( + (string) $r->getReturnType(), + $p, + (string) $p[0]->getType(), + (string) $p[1]->getType() +); +?> +--EXPECT-- +string(4) "bool" +array(2) { + [0]=> + object(ReflectionParameter)#2 (1) { + ["name"]=> + string(8) "promises" + } + [1]=> + object(ReflectionParameter)#3 (1) { + ["name"]=> + string(12) "execpromises" + } +} +string(6) "string" +string(6) "string" +string(4) "bool" +array(2) { + [0]=> + object(ReflectionParameter)#1 (1) { + ["name"]=> + string(4) "path" + } + [1]=> + object(ReflectionParameter)#5 (1) { + ["name"]=> + string(11) "permissions" + } +} +string(6) "string" +string(6) "string"