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
* Only *unqualified* function calls in a namespace context can be mocked.
71
+
E.g. a call for `time()` in the namespace `foo` is mockable,
72
+
a call for `\time()` is not.
73
+
74
+
* The mock has to be defined before the first call to the unqualified function
75
+
in the tested class. This is documented in [Bug #68541](https://bugs.php.net/bug.php?id=68541).
76
+
In most cases you can ignore this restriction. But if you happen to run into
77
+
this issue you can call [`PHPMock::defineFunctionMock()`](http://php-mock.github.io/php-mock-phpunit/api/class-phpmock.phpunit.PHPMock.html#_defineFunctionMock)
78
+
before that first call (e.g. with `@beforeClass`).
79
+
This would define a side effectless namespaced function.
0 commit comments