-
-
Notifications
You must be signed in to change notification settings - Fork 932
-
I'm working on a Restricted Usage Extension for class names, methods and properties and wonder what the best way would be to test them.
I've read but it does not explicitly answer it for this type of extension: https://phpstan.org/developing-extensions/testing
Since it's about errors, I kind of feel this should be a Rule test case... not the TypeInferenceTestCase.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
Yeah, sure. Find an existing rule that asks about this and write a new RuleTestCase and return the existing rule by doing self::getContainer()->getByType().
I'm on a phone, you should be able to find it by checking where are the extensions of this type gathered and called.
Beta Was this translation helpful? Give feedback.
All reactions
-
And register the extensions in a .neon file you'll return from getAdditionalConfigFiles.
Beta Was this translation helpful? Give feedback.