You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a project that uses PHPUnit and Psalm, Psalm detects the issue in PHPUnit that cannot be fixed in the project and therefore have to be suppressed.
Current behavior
ERROR: PropertyNotSetInConstructor - tests/ExampleTest.php:7:7 - Property
Test\ExampleTest::$backupGlobals is not defined in constructor of Test\ExampleTest and in any
methods called in the constructor (see https://psalm.dev/074)
class ExampleTest extends TestCase
The above is caused by a boolean property being non-initialized:
Summary
In a project that uses PHPUnit and Psalm, Psalm detects the issue in PHPUnit that cannot be fixed in the project and therefore have to be suppressed.
Current behavior
The above is caused by a boolean property being non-initialized:
phpunit/src/Framework/TestCase.php
Lines 63 to 66 in 61f7c75
phpunit/src/Framework/TestCase.php
Lines 389 to 397 in 61f7c75
How to reproduce
See the full demo project in the gist:
Since the project's tests extend and use the PHPUnit test classes, suppressing errors in the
vendor/
directory doesn't help.Expected behavior
The value of
$backupGlobals
is always within its declared type constraints.The text was updated successfully, but these errors were encountered: