You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the foo() method is called during the test, we get the error "Return value must be of type Foo, null returned" instead of the "No calls expected that match: SomeClass::foo()" from NoCallsPrediction.
This makes debugging tests very hard, because the error suggests that we accidentally returned null in a method that, in fact, should not have been called.
Given the following class:
and the following test:
If the
foo()
method is called during the test, we get the error "Return value must be of type Foo, null returned" instead of the "No calls expected that match:SomeClass::foo()
" fromNoCallsPrediction
.This makes debugging tests very hard, because the error suggests that we accidentally returned
null
in a method that, in fact, should not have been called.I have made a reproducer for this issue to make it more clear: https://github.com/Deuchnord/prophecy-reproducer
The text was updated successfully, but these errors were encountered: