-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
assert not working in anonymous class #5651
Comments
@root-aza I tried to reproduce the issue and i don't see any issues. My guess is that you didn't call the function inside the anonyomous class thus the assert didn't get triggered. |
@marac19901990 mmm. No)) |
The problem is that i can'tt reproduce it in a minimal setup, which would allow me to ads it to the tests in phpunit. In your repository example there are a lot of dependencies which are not relevant for this project, will try some more... |
|
Well, in a minimal setup I think it works for everyone =)) And it seems to me that it doesn’t matter what code is being tested, the framework should report an assert. Maybe I'm wrong... |
It is clear that everywhere has its limitations, but it seems to me that the framework should freely handle this case. |
@root-aza Instead of @sebastianbergmann you can close this |
Um. this is not correct and the code will fail in typing.
UPD: |
I didn't explain myself well, sorry. I just wanted to say that when i do this:
The assert gets executed, so it is not a phpunit issue, I didn't go further into debugging what happens. |
@root-aza
if you rethrow the exception it will run the assertions, this shows that the sentry package captures the exceptions and doesnt propagate them further, and that is why phpunit doesn't register them. |
Yep. |
I have no idea what you are trying to report here, sorry. |
Summary
Current behavior
assert do not fire, although the condition is definitely false
How to reproduce
Repository with test
Expected behavior
The text was updated successfully, but these errors were encountered: