psalm: PropertyNotSetInConstructor error for PHPunit test
Error:
ERROR: PropertyNotSetInConstructor - tests/ConfigTest.php:9:7 - Property Name\New\TestCase\ConfigTest::$backupStaticAttributes is not defined in constructor of Name\New\TestCase\ConfigTest and in any methods called in the constructor (see https://psalm.dev/074)
class ConfigTest extends TestCase
How can I fix it?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15
This solved my problem:
You have to run psalm --init first if you don’t already have a config file
Replace
plugin-vendor/plugin-package
withpsalm/plugin-phpunit
. Do you have any suggestions on how we could make that more clear in the docs?Never heard of it, so I won’t be able to help you with it.
If you commit both
psalm.xml
andcomposer.lock
, and runcomposer install
as a part of your action it’s already enabled.