-
-
Notifications
You must be signed in to change notification settings - Fork 365
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
[2.x] Add toBeStringBackedEnum()
and toBeIntBackedEnum()
Architecture Expectations
#1006
[2.x] Add toBeStringBackedEnum()
and toBeIntBackedEnum()
Architecture Expectations
#1006
Conversation
toBeBackedEnum()
ExpectationtoBeBackedEnum()
Architecture Expectation
toBeBackedEnum()
Architecture ExpectationtoBeBackedEnum()
Architecture Expectation
toBeBackedEnum()
Architecture ExpectationtoBeStringBackedEnum()
and toBeIntBackedEnum()
Architecture Expectations
Hey @owenvoke 👋 Do you have any idea whats up with the failing tests on this PR? Static Analysis is failing but doesn't seem to actually be related to this PR
Any help would be much appreciated! Thanks |
I have fixed it in pestphp/pest-plugin-type-coverage#15. Just waiting to be merged! |
Awesome, thanks for letting me know @faissaloux 😄 |
Hey @devajmeireles Would you be able to re-run the checks on this PR please? I believe the 2 failing ones should now pass thanks to pestphp/pest-plugin-type-coverage#17 Thanks! |
Hey @nunomaduro 👋 Would you be open to having these 2 new Arch Expectations in Pest? I'm going through my open PR's before the end of the year in an effort to get them merged/closed. I look forward to hearing from you! Thanks |
Thank you! 🥳 |
What:
Description:
We already have the very handy
toBeEnum()
Arch Expectation, which is useful for Pure Enums. This PR adds 2 similar Expectations, specifically for Backed Enums:toBeStringBackedEnum()
toBeIntBackedEnum()
By writing the following test, we can ensure that it is actually a String Backed Enum.
We could also change the test if the Enum returned an Int:
Docs: pestphp/docs#247