Skip to content

Commit

Permalink
chore: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ging-dev committed Oct 16, 2023
1 parent 3c6790b commit 0be6c8c
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tests/Cache/CacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,5 +248,51 @@ public function foo($baz): void
],
],
];

yield 'constructorPropertyPromotionChange' => [
[
[
'files' => [
'/src/A.php' => <<<'PHP'
<?php
class A {
public function __construct(private string $foo)
{
}
public function bar(): string
{
return $this->foo;
}
}
PHP,
],
'issues' => [],
],
[
'files' => [
'/src/A.php' => <<<'PHP'
<?php
class A
{
public function __construct()
{
}
public function bar(): string
{
return $this->foo;
}
}
PHP,
],
'issues' => [
'/src/A.php' => [
"UndefinedThisPropertyFetch: Instance property A::\$foo is not defined",
"MixedReturnStatement: Could not infer a return type",
"MixedInferredReturnType: Could not verify return type 'string' for A::bar",
],
],
],
],
];
}
}

0 comments on commit 0be6c8c

Please sign in to comment.