Skip to content

Commit

Permalink
MFH: Add tests for ReflectionFunction::getExtension*().
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed May 11, 2008
1 parent 9aa57f0 commit b5281c7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ext/reflection/tests/ReflectionFunction_getExtension.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--TEST--
ReflectionFunction::getExtension()
--FILE--
<?php
function foo () {}

$function = new ReflectionFunction('sort');
var_dump($function->getExtension());

$function = new ReflectionFunction('foo');
var_dump($function->getExtension());
?>
--EXPECTF--
object(ReflectionExtension)#%i (1) {
["name"]=>
string(8) "standard"
}
NULL

16 changes: 16 additions & 0 deletions ext/reflection/tests/ReflectionFunction_getExtensionName.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--TEST--
ReflectionFunction::getExtensionName()
--FILE--
<?php
function foo() {}

$function = new ReflectionFunction('sort');
var_dump($function->getExtensionName());

$function = new ReflectionFunction('foo');
var_dump($function->getExtensionName());
?>
--EXPECT--
string(8) "standard"
bool(false)

0 comments on commit b5281c7

Please sign in to comment.