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 Sep 30, 2023
1 parent 7f130e8 commit 34282ab
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 @@ -199,5 +199,51 @@ class B {
],
],
];

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 34282ab

Please sign in to comment.