Activity

Same problem here. I wanted to write some unit tests, checking the entity relations and ran into exactly the same problem. Maybe my code can provide some more information (Group entity is the owning side, role entity is the inverse side):

Your code is very weird btw, why are you getting and setting groups collection? It is passed by reference so you can just have something like $role->addGroup() and $role->removeGroup() and encapsulate the logic?

Also your tests are pretty useless, you check if two variables which are the same reference to the same collection are the same. Which should always be true.

@Lee

Can you provide more details? I cant verify this without more details.

Benjamin Eberlei
added a comment - 20/Feb/12 10:33 AM @Steve
I cannot reproduce your issue.
Attached is a test script.
Your code is very weird btw, why are you getting and setting groups collection? It is passed by reference so you can just have something like $role->addGroup() and $role->removeGroup() and encapsulate the logic?
Also your tests are pretty useless, you check if two variables which are the same reference to the same collection are the same. Which should always be true.
@Lee
Can you provide more details? I cant verify this without more details.