From 1a335c4dc1b9b5ad34e507597c90aba55ff55d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20M=C3=AD=C5=A1ek?= Date: Sun, 25 Aug 2019 22:57:07 +0200 Subject: [PATCH] tests from recent issues --- tests/datetime/clone_003.php | 12 ++++++ tests/functions/callback_003.php | 23 ++++++++++ tests/functions/param_default.php | 14 ++++++- .../assign_003.php} | 0 tests/reflection/ReflectionMethod_001.php | 42 +++++++++++++++++++ tests/variables/isset_003.php | 10 +++++ 6 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 tests/datetime/clone_003.php create mode 100644 tests/functions/callback_003.php rename tests/{transformations/assign_001.php => operators/assign_003.php} (100%) create mode 100644 tests/reflection/ReflectionMethod_001.php create mode 100644 tests/variables/isset_003.php diff --git a/tests/datetime/clone_003.php b/tests/datetime/clone_003.php new file mode 100644 index 000000000..8ab8477dd --- /dev/null +++ b/tests/datetime/clone_003.php @@ -0,0 +1,12 @@ +var; + } +} + +class TestClass extends BaseClass +{ + public function testFunc() + { + return call_user_func_array("parent::testFunc", []); + } +} + +echo (new TestClass())->testFunc(), PHP_EOL; + +echo "Done."; \ No newline at end of file diff --git a/tests/functions/param_default.php b/tests/functions/param_default.php index 53b772154..127652f5f 100644 --- a/tests/functions/param_default.php +++ b/tests/functions/param_default.php @@ -1,8 +1,16 @@ class, PHP_EOL; // C + echo $m->getPrototype()->class, PHP_EOL; // I + + $m = new ReflectionMethod("B", "f"); + echo $m->getPrototype()->class, PHP_EOL; // A + + try { + echo $m->getPrototype()->getPrototype()->class, PHP_EOL; // ReflectionException + } + catch (Throwable $e) { + echo "no prototype", PHP_EOL; + } +} + +test(); + +echo "Done."; diff --git a/tests/variables/isset_003.php b/tests/variables/isset_003.php new file mode 100644 index 000000000..49bcfa68a --- /dev/null +++ b/tests/variables/isset_003.php @@ -0,0 +1,10 @@ +