Skip to content

Commit

Permalink
Added a test for #50
Browse files Browse the repository at this point in the history
  • Loading branch information
antecedent committed Mar 23, 2017
1 parent 67802dc commit b9dd9ba
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ language: php
script: phpunit tests
php:
- hhvm
- 7
- 7.1
- 7.0
- 5.6
- 5.5
- 5.4
Expand Down
17 changes: 17 additions & 0 deletions tests/includes/ProxyForInternals.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@
'baz, but in lowercase',
]);

# Preserve behavior of call_user_func etc.
class SelfCaller
{
static function first($x)
{
return call_user_func('self::second', $x);
}

static function second($x)
{
return $x * 2;
}
}

assert(SelfCaller::first(21) === 42);


# Dynamic calls
$function = 'str' . 'len';
p\redefine('strlen', p\always('?!'));
Expand Down

0 comments on commit b9dd9ba

Please sign in to comment.