From cd323b630d9e2d9458257aa89caebffa0fa69729 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Thu, 17 Oct 2024 15:25:30 -0700 Subject: [PATCH] Reflection: add lazy ghost tests for GH-15902 Split from patch in GH-15922 since lazy ghosts are 8.4+ --- .../tests/gh15902/ReflectionClass-dots.phpt | 39 +++++++++++++++++++ .../gh15902/ReflectionProperty-dots.phpt | 22 +++++++++++ 2 files changed, 61 insertions(+) create mode 100644 ext/reflection/tests/gh15902/ReflectionClass-dots.phpt create mode 100644 ext/reflection/tests/gh15902/ReflectionProperty-dots.phpt diff --git a/ext/reflection/tests/gh15902/ReflectionClass-dots.phpt b/ext/reflection/tests/gh15902/ReflectionClass-dots.phpt new file mode 100644 index 0000000000000..1c4a2346a1b1c --- /dev/null +++ b/ext/reflection/tests/gh15902/ReflectionClass-dots.phpt @@ -0,0 +1,39 @@ +--TEST-- +ReflectionClass object default property - used to say "..." +--FILE-- +newLazyGhost(function () {}); + +define('FOO', new stdClass); + +$c->a; + +var_dump( (string)$reflector ); + +?> +--EXPECTF-- +string(%d) "Class [ class C ] { + @@ %sReflectionClass-dots.php %d-%d + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ public stdClass $a = object(stdClass) ] + } + + - Methods [0] { + } +} +" diff --git a/ext/reflection/tests/gh15902/ReflectionProperty-dots.phpt b/ext/reflection/tests/gh15902/ReflectionProperty-dots.phpt new file mode 100644 index 0000000000000..a0997d07d33db --- /dev/null +++ b/ext/reflection/tests/gh15902/ReflectionProperty-dots.phpt @@ -0,0 +1,22 @@ +--TEST-- +ReflectionProperty object default - used to say "..." +--FILE-- +newLazyGhost(function () {}); + +define('FOO', new stdClass); + +$c->a; + +var_dump( (string)$reflector ); + +?> +--EXPECTF-- +string(%d) "Property [ public stdClass $a = object(stdClass) ] +"