Closed kretowicz14 closed 4 years ago
It is known that at()
counts "weird". Changing how it counts would break backward compatibility in an even weirder way.
I consider the use of at()
a bad practice. Maybe it is time to deprecate it and completely remove it later?
You cant well check assertions of same methods when other method expect return collection of elements. So only functional tests can test that properly :/
Summary
When make on mock objects (this is working example):
This is error exaple:
In this case he expects
$newTemporaryCustomerSecond
on index 0Debuger is showing we iterate on object1, object2 (and make save's), but phpunit mock object is counting save method on 1 & 3, not 0 & 1.
In other case i must start counting from 0, and next use at 2, at 4 etc.
Current behavior
Counting index on mock object.
How to reproduce
I think its problem when you got mocked object what iniject other services, and other services made save (he shouldn't count other methods inside iniject services).
Expected behavior
Fix index on mock objects.