-
Notifications
You must be signed in to change notification settings - Fork 154
As of 3.2.4 some mocked objects now through an undefined index message failing the unit test #321
Comments
It looks to be an ordering issue.. From another test failing
We get
If we change the order of the array in set methods to
We then get
|
Thank you for your report. Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting. Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue. |
Just to be sure: this issue is not present in phpunit-mock-objects 3.2.3, right? |
@sebastianbergmann Aye, no worries, just in a meeting but will get the minimal test for you. And yes, 3.2.3 works fine if I checkout that tag |
@sebastianbergmann It is our code.. We do not hit
So we get the error in
As It is because we actually have to specify the full path to the class even though we have a use statement at the top:
Sorry for hassling |
Actually, just looking at a test where it isn't namespaced |
Do you mean that this can be closed because it's a problem in your code? |
Let me check this one that isn't a namespace, then will close or report back :) |
Closing as it is our code.. There is a subtle change here, but it's our code that needs to deal with it. Thanks |
@sebastianbergmann : the doctrine/dbal project builds mock from some classes that do not exist . I'm replacing all these class names with |
I am also running into this issue. You used to be able to mock a class that didn't exist, but that is no longer possible. I'll put together a simple reproduction case, but in the meantime you can see nubs/sensible#29 for what I did to get around it for now. |
https://gist.github.com/nubs/ddb081e1d1b09541d7f7a1d93d009533 is a simple reproduction case. Didn't take too long to write up :) |
@sebastianbergmann FYI, what @nubs and @greg0ire are saying was exactly the issue I had.. Before this release it was silently allowing you to mock an non-existent object (Rightly or wrongly!). Not sure if it either needs to be more clear you are mocking a non-existent object or not, as developers will make mistakes. |
As mentioned on twitter, still not sure if we are doing something odd that is now exposed as of 3.2.4 or if it's a bug in this repo
Worked in 3.2.3 but now we get
The text was updated successfully, but these errors were encountered: