When mocking method calls with complex objects (doctrine entities) I got PHP errors today: "PHP Fatal error: Nesting level too deep - recursive dependency?"
The problem lies in the class method ExactValueToken#scoreArgument
When the ObjectComparator throws a ComparisonFailure this method just ignores it - I don't see why because the phpunit comparator works quite well and seems to already cover recursion.
ExactValueToken then goes on and tries to compare the 2 objects with $argument == $this->value which causes a PHP internal nesting error - see also: https://stackoverflow.com/a/19097159/2424814
When mocking method calls with complex objects (doctrine entities) I got PHP errors today: "PHP Fatal error: Nesting level too deep - recursive dependency?"
This issue has already been discussed here: https://github.com/phpspec/prophecy/issues/268
The problem lies in the class method
ExactValueToken#scoreArgument
When the ObjectComparator throws aComparisonFailure
this method just ignores it - I don't see why because the phpunit comparator works quite well and seems to already cover recursion.ExactValueToken
then goes on and tries to compare the 2 objects with$argument == $this->value
which causes a PHP internal nesting error - see also: https://stackoverflow.com/a/19097159/2424814I've fixed this and added some tests.