@@ 29-41 (lines=13) @@ | ||
26 | $this->assertEquals(UnitOfWork::STATE_NEW, $this->dm->getUnitOfWork()->getDocumentState($user)); |
|
27 | } |
|
28 | ||
29 | public function testDetachedKnownObject() |
|
30 | { |
|
31 | $user = new CmsUser(); |
|
32 | $user->username = "beberlei"; |
|
33 | $user->name = "Benjamin"; |
|
34 | ||
35 | $this->dm->persist($user); |
|
36 | $this->dm->flush(); |
|
37 | ||
38 | $this->dm->detach($user); |
|
39 | ||
40 | $this->assertEquals(UnitOfWork::STATE_DETACHED, $this->dm->getUnitOfWork()->getDocumentState($user)); |
|
41 | } |
|
42 | } |
@@ 63-76 (lines=14) @@ | ||
60 | $this->assertSame($mergedUser->id, $user->id); |
|
61 | } |
|
62 | ||
63 | public function testMergeRemovedDocument() |
|
64 | { |
|
65 | $user = new CmsUser(); |
|
66 | $user->username = "beberlei"; |
|
67 | $user->name = "Benjamin"; |
|
68 | ||
69 | $this->dm->persist($user); |
|
70 | $this->dm->flush(); |
|
71 | ||
72 | $this->dm->remove($user); |
|
73 | ||
74 | $this->setExpectedException('InvalidArgumentException', 'Removed document detected during merge. Can not merge with a removed document.'); |
|
75 | $this->dm->merge($user); |
|
76 | } |
|
77 | ||
78 | public function testMergeWithManagedDocument() |
|
79 | { |