From f4d62b317e722558eb06d6ca3d412776e306e418 Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Sat, 14 May 2011 00:49:46 -0300 Subject: [PATCH] Fixed endless recursion of DDC-719 test. --- .../Tests/ORM/Functional/Ticket/DDC719Test.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC719Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC719Test.php index 5c6af8a42..82cb67223 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC719Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC719Test.php @@ -77,21 +77,23 @@ class DDC719Group extends Entity { * adds group as new child * * @param Group $child - * @todo check against endless recursion - * @todo check if the group is already member of the group */ public function addGroup(Group $child) { - $this->children->add($child); + if ( ! $this->children->contains($child)) { + $this->children->add($child); + $child->addGroup($this); + } } /** * adds channel as new child * * @param Channel $child - * @todo check if the channel is already member of the group */ public function addChannel(Channel $child) { - $this->channels->add($child); + if ( ! $this->channels->contains($child)) { + $this->channels->add($child); + } } /**