-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Mocking new does not work properly in a few cases #42
Comments
That last commit fixes most of those bugs, they are mostly caused by the same thing ... The only outstanding one is the import one ... let me think about that one ... |
This seems to have broken completely just recently. When I run a.php, I get
|
@maxgoldberg uopz_set_mock() doesn't seem to work at all (anymore) if Xdebug is loaded; see #61. |
It also does not replace the class where it is extended by another class, e.g.
Expected:
Actual:
|
If there are still outstanding problems here, please open new reports ... |
The original code this bug report was opened with works now if you modify the second call to set_mock thus:
It should be documented that class names should be as zend would resolve them, if you wrote that as |
Done. |
Cf. <krakjoe/uopz#42 (comment)>. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@346524 c90b9560-bf6c-de11-be94-00142212c4b1
Cf. <krakjoe/uopz#42 (comment)>. git-svn-id: http://svn.php.net/repository/phpdoc/en@346524 c90b9560-bf6c-de11-be94-00142212c4b1
Cf. <krakjoe/uopz#42 (comment)>. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@346524 c90b9560-bf6c-de11-be94-00142212c4b1
Cf. <krakjoe/uopz#42 (comment)>. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@346524 c90b9560-bf6c-de11-be94-00142212c4b1
The cases which appear not to be handled by uopz (php7):
new $variable
use Ns\X as Y; new Y;
uopz_set_mock('\\Ns\\X',....);
The issues are showcased in the code below:
a.php
ns.php
b.php
Environment details:
I'd bet all of the constructor calls should return an object of one of the Bar classes but that's not the case as shown in the code even though I actually requested uopz to mock all the Foo classes.
Is it something that could be fixed?
The text was updated successfully, but these errors were encountered: