doctrine/phpcr-odm — pull request #179 by simensen (2012-09-21 00:06:31+00:00)
Title: Added test showing potential problems with ReferenceManyCollection

I was able to sort of reproduce some of the problems I've been having with the reference collections. It looks like `ReferenceManyCollection` has some unexpected behavior. For example, calling `count` on a reference after unsetting its only value will return `1` even though it should return `0`.

The behavior I was seeing is even though I was calling `unset($collection[0])` or `$collection->remove(0)` the item would still remain associated after a `flush()`. The last section of this test was designed to see if that was happening on a smaller test case but to my surprise I found that earlier assertions were failing on `count()`. Hopefully they are all related.