Skip to content

Commit

Permalink
Reflection info test
Browse files Browse the repository at this point in the history
  • Loading branch information
tvlooy committed Oct 13, 2018
1 parent 6f6afc7 commit 92a684f
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions tests/reflection.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
--TEST--
test reflection of pledge() and unveil() functions
--FILE--
<?php
$r = new ReflectionFunction('pledge');
$p = $r->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"

0 comments on commit 92a684f

Please sign in to comment.