-
-
Notifications
You must be signed in to change notification settings - Fork 379
Enumerations cannot be targeted for code coverage #1061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I keep forgetting that enumerations in PHP are more than just enumerations, sorry. Are you telling me that enumerations could be targetted with |
No need to be sorry, it happens. PHPUnit 12 already found a couple of minor issues in my testcode that are now fixed. I used I've no problem with changing the configuration to something new/different, but right now it appears it isn't possible to configure coverage for enums at all in PHPUnit 12. |
Okay, this is a regression then. |
Should have been fixed by 68403fa. I have released version 12.0.1 of this library with that change. |
Confirmed it is now working fine for me. |
Summary
Unable to configure code coverage for Enums.
Current behavior
When configuring coverage or usage using
coversClass
orusesClass
attributes it gives me the following error:Class ..... is not a valid target for code coverage
I tried configuring coverage using
coversNamespace
but got a similar error.How to reproduce
Create an Enum and try to configure coverage in a TestCase.
Expected behavior
I can configure coverage for an Enum on my TestCases.
Maybe with specific attributes like
coversEnum
andusesEnum
, but the...Class
attributes might work just fine if they accept enums.The text was updated successfully, but these errors were encountered: