Skip to content

Commit 656c320

Browse files
committed
Specify when the substitution doesn't work.
1 parent a0106f6 commit 656c320

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

allow.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ it("shows some examples of function stubbing", function() {
154154
// Monkey patch `PDO` with a specific class.
155155
allow('PDO')->toBe('My\Alternative\PDO');
156156

157-
// Monkey patch `DateTime` with a specific instance (PHP>=7 only).
157+
// Monkey patch `DateTime` with a specific instance
158+
// WARNING: instance substitution doesn't work by reference.
159+
// Ex: `$date =& $obj->myDate()`, the date won't be substited here.
158160
allow('DateTime')->toBe(new DateTime('@123'));
159161

160162
// Monkey patch `PDO` with a generic stub instance.

0 commit comments

Comments
 (0)