8000 added test case for typed properties without default value, issue #32465 · symfony/symfony@308261a · GitHub
[go: up one dir, main page]

Skip to content

Commit 308261a

Browse files
committed
added test case for typed properties without default value, issue #32465
1 parent 5e98b8f commit 308261a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Symfony/Component/Config/Tests/Resource/ReflectionClassResourceTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,26 @@ public function provideHashedSignature()
136136
yield [0, 15, ''];
137137
}
138138

139+
/**
140+
* Typed properties without a default value are undefined,
141+
* make sure this doesn't throw an error when generating a signature.
142+
*
143+
* @depends testHashedSignature
144+
* @dataProvider provideTypedProperties
145+
* @requires PHP >= 7.4
146+
*/
147+
public function testTypedProperies($changeExpected, $changedLine, $changedCode)
148+
{
149+
$this->testHashedSignature($changeExpected, $changedLine, $changedCode);
150+
}
151+
152+
public function provideTypedProperties()
153+
{
154+
yield [1, 5, 'public array $pub;'];
155+
yield [0, 7, 'protected int $prot;'];
156+
yield [0, 9, 'private string $priv;'];
157+
}
158+
139159
public function testEventSubscriber()
140160
{
141161
$res = new ReflectionClassResource(new \ReflectionClass(TestEventSubscriber::class));

0 commit comments

Comments
 (0)
0