diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-29 13:10:46 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-29 13:10:46 +0100 |
commit | 7b7efa4f80dc5c9d26b59087270a8d89fedcc808 (patch) | |
tree | 1dfb0ce4a6662a5bcb6562b40ab91f813a959afc /tests/php/phpt/variables/016-calling-php-functions.phpt | |
parent | c0e1f20eeab6445d6355ea11ef7d264cb37c52cf (diff) | |
parent | 8bd7f5162870e4b39c7629c1a67a3372402406c9 (diff) |
Merge pull request #56 from valmat/tests
New tests
Diffstat (limited to 'tests/php/phpt/variables/016-calling-php-functions.phpt')
-rw-r--r-- | tests/php/phpt/variables/016-calling-php-functions.phpt | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/tests/php/phpt/variables/016-calling-php-functions.phpt b/tests/php/phpt/variables/016-calling-php-functions.phpt new file mode 100644 index 0000000..46fda6e --- /dev/null +++ b/tests/php/phpt/variables/016-calling-php-functions.phpt @@ -0,0 +1,113 @@ +--TEST-- +calling-php-Callback-functions (__invoke) +--SKIPIF-- +<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?> +--FILEEOF-- +<?php + + +class CallableClass { + public function __invoke() { + echo("Callback called with parameters:\n"); + var_export(func_get_args ()); + } +} + +TestVariables\fnCallback(new CallableClass()); + + +--EXPECT-- +call callback +Callback called with parameters: +array ( + 0 => 'param1', +)Callback called with parameters: +array ( + 0 => 'param1', + 1 => 'param2', +)Callback called with parameters: +array ( + 0 => 'param1', + 1 => 'param2', + 2 => 'param3', +)Callback called with parameters: +array ( + 0 => 'param1', + 1 => 'param2', + 2 => 'param3', + 3 => 'param4', +)Callback called with parameters: +array ( + 0 => 'param1', + 1 => 'param2', + 2 => 'param3', + 3 => 'param4', + 4 => + array ( + 0 => 'param5', + 1 => 3.14159265359, + 2 => 28032014, + 'key' => 'value', + ), +)Callback called with parameters: +array ( + 0 => 'param1', + 1 => 'param2', + 2 => 'param3', + 3 => 'param4', + 4 => + array ( + 0 => 'param5', + 1 => 3.14159265359, + 2 => 28032014, + 'key' => 'value', + ), + 5 => + DateTime::__set_state(array( + 'date' => '2014-03-28 19:42:15', + 'timezone_type' => 3, + 'timezone' => 'Asia/Yekaterinburg', + )), +)Callback called with parameters: +array ( + 0 => 'param1', + 1 => 'param2', + 2 => 'param3', + 3 => 'param4', + 4 => 'param5', + 5 => 'param6', + 6 => 'param7', +)Callback called with parameters: +array ( + 0 => 'param1', + 1 => 'param2', + 2 => 'param3', + 3 => 'param4', + 4 => 'param5', + 5 => 'param6', + 6 => 'param7', + 7 => 'param8', +)Callback called with parameters: +array ( + 0 => 'param1', + 1 => 'param2', + 2 => 'param3', + 3 => 'param4', + 4 => 'param5', + 5 => 'param6', + 6 => 'param7', + 7 => 'param8', + 8 => 'param9', +)Callback called with parameters: +array ( + 0 => 'param1', + 1 => 'param2', + 2 => 'param3', + 3 => 'param4', + 4 => 'param5', + 5 => 'param6', + 6 => 'param7', + 7 => 'param8', + 8 => 'param9', + 9 => 'param10', +)
\ No newline at end of file |