Skip to content

Commit 8dd236b

Browse files
reinholdfueredersebastianbergmann
authored andcommitted
Mention @Depends shallowclone
Besides @Depends clone. And try to explain the difference.
1 parent 29e117e commit 8dd236b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/writing-tests-for-phpunit.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@ depends upon ``testPush()``.
143143

144144
The return value yielded by a producer is passed "as-is" to its
145145
consumers by default. This means that when a producer returns an object,
146-
a reference to that object is passed to the consumers. When a copy
147-
should be used instead of a reference, then @depends clone
148-
should be used instead of @depends.
146+
a reference to that object is passed to the consumers. Instead of
147+
a reference either (a) a (deep) copy via ``@depends clone``, or (b) a
148+
(normal shallow) clone (based on PHP keyword ``clone``) via
149+
``@depends shallowClone`` are possible too.
149150

150151
To quickly localize defects, we want our attention to be focussed on
151152
relevant failing tests. This is why PHPUnit skips the execution of a test

0 commit comments

Comments
 (0)