Skip to content

Commit

Permalink
added test case for typed properties without default value, issue #32465
Browse files Browse the repository at this point in the history
  • Loading branch information
tvandervorm committed Jul 14, 2019
1 parent 5e98b8f commit 747330f
Showing 1 changed file with 18 additions and 0 deletions.
Expand Up @@ -136,6 +136,24 @@ public function provideHashedSignature()
yield [0, 15, ''];
}

/**
* Typed properties without a default value are undefined,
* make sure this doesn't throw an error when generating a signature.
*
* @depends testHashedSignature
* @dataProvider provideTypedProperties
* @requires PHP >= 7.4
*/
public function testTypedProperies($changeExpected, $changedLine, $changedCode) {
$this->testHashedSignature($changeExpected, $changedLine, $changedCode);
}

public function provideTypedProperties() {
yield [1, 5, 'public array $pub;'];
yield [0, 7, 'protected int $prot;'];
yield [0, 9, 'private string $priv;'];
}

public function testEventSubscriber()
{
$res = new ReflectionClassResource(new \ReflectionClass(TestEventSubscriber::class));
Expand Down

0 comments on commit 747330f

Please sign in to comment.