Details
-
Type:
Bug
-
Status:
Awaiting Feedback
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: ORM
-
Security Level: All
-
Labels:None
-
Environment:Symfony2
Activity
Benjamin Eberlei
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Priority | Major [ 3 ] | Minor [ 4 ] |
Benjamin Eberlei
made changes -
| Attachment | DDC1630Test.php [ 11164 ] |
Benjamin Eberlei
made changes -
| Workflow | jira [ 13405 ] | jira-feedback [ 14019 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback [ 14019 ] | jira-feedback2 [ 15883 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback2 [ 15883 ] | jira-feedback3 [ 18139 ] |
Benjamin Eberlei
made changes -
| Status | Open [ 1 ] | Awaiting Feedback [ 10000 ] |
Alexander
made changes -
| Status | In Progress [ 3 ] | Awaiting Feedback [ 10000 ] |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-1630, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
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):
WHAT DOES NOT WORK:
/** * Test ArrayCollection */ $group = new Group('Group Test'); $em->persist($group); $em->flush(); $groups = new ArrayCollection(); $groups->add($group); $this->role->setGroups($groups); $this->assertEquals($groups, $this->role->getGroups()); /** * Test PersistentCollection */ $em->persist($this->role); $em->flush(); $groups = $this->role->getGroups(); $groups->removeElement($group); // first remove element before adding a new one $group = new Group('Group Test 2'); $em->persist($group); $em->flush(); $groups->add($group); $this->role->setGroups($groups); $this->assertEquals($groups, $this->role->getGroups());WHAT WORKS:
/** * Test ArrayCollection */ $group = new Group('Group Test'); $em->persist($group); $em->flush(); $groups = new ArrayCollection(); $groups->add($group); $this->role->setGroups($groups); $this->assertEquals($groups, $this->role->getGroups()); /** * Test PersistentCollection */ $em->persist($this->role); $em->flush(); $groups = $this->role->getGroups(); $group2 = new Group('Group Test 2'); $em->persist($group2); $em->flush(); $groups->add($group2); // first adding a new element before removing one $groups->removeElement($group); $this->role->setGroups($groups); $this->assertEquals($groups, $this->role->getGroups());Hope this helps in any way... I tried figuring it out on my own but I am too drunk right now xD