The test is wrong becaues of this line, when calling ->persist() the entity is managed, not NEW. You can move this line into the if condition below and then it passes green.

Hash collisions are ok, Doctrine fixes them by cleaning the internals of the UoW up.