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

Skip to content

Commit 747330f

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

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Expand all lines: src/Symfony/Component/Config/Tests/Resource/ReflectionClassResourceTest.php
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,24 @@ 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+
$this->testHashedSignature($changeExpected, $changedLine, $changedCode);
149+
}
150+
151+
public function provideTypedProperties() {
152+
yield [1, 5, 'public array $pub;'];
153+
yield [0, 7, 'protected int $prot;'];
154+
yield [0, 9, 'private string $priv;'];
155+
}
156+
139157
public function testEventSubscriber()
140158
{
141159
$res = new ReflectionClassResource(new \ReflectionClass(TestEventSubscriber::class));

0 commit comments

Comments
 (0)
0