@@ 1081-1097 (lines=17) @@ | ||
1078 | /** |
|
1079 | * @group DDC-720 |
|
1080 | */ |
|
1081 | public function testFlushSingleManagedEntity() |
|
1082 | { |
|
1083 | $user = new CmsUser; |
|
1084 | $user->name = 'Dominik'; |
|
1085 | $user->username = 'domnikl'; |
|
1086 | $user->status = 'developer'; |
|
1087 | ||
1088 | $this->_em->persist($user); |
|
1089 | $this->_em->flush(); |
|
1090 | ||
1091 | $user->status = 'administrator'; |
|
1092 | $this->_em->flush($user); |
|
1093 | $this->_em->clear(); |
|
1094 | ||
1095 | $user = $this->_em->find(get_class($user), $user->id); |
|
1096 | $this->assertEquals('administrator', $user->status); |
|
1097 | } |
|
1098 | ||
1099 | /** |
|
1100 | * @group DDC-720 |
|
@@ 1199-1216 (lines=18) @@ | ||
1196 | * @group DDC-1612 |
|
1197 | * @group DDC-2267 |
|
1198 | */ |
|
1199 | public function testFlushSingleNewEntityThenRemove() |
|
1200 | { |
|
1201 | $user = new CmsUser; |
|
1202 | $user->name = 'Dominik'; |
|
1203 | $user->username = 'domnikl'; |
|
1204 | $user->status = 'developer'; |
|
1205 | ||
1206 | $this->_em->persist($user); |
|
1207 | $this->_em->flush($user); |
|
1208 | ||
1209 | $userId = $user->id; |
|
1210 | ||
1211 | $this->_em->remove($user); |
|
1212 | $this->_em->flush($user); |
|
1213 | $this->_em->clear(); |
|
1214 | ||
1215 | $this->assertNull($this->_em->find(get_class($user), $userId)); |
|
1216 | } |
|
1217 | ||
1218 | /** |
|
1219 | * @group DDC-720 |
@@ 19-35 (lines=17) @@ | ||
16 | parent::setUp(); |
|
17 | } |
|
18 | ||
19 | public function testChangeSetPlusWeirdPHPCastingIntCastingRule() |
|
20 | { |
|
21 | $user = new CmsUser(); |
|
22 | $user->name = "John Galt"; |
|
23 | $user->username = "jgalt"; |
|
24 | $user->status = "+44"; |
|
25 | ||
26 | $this->_em->persist($user); |
|
27 | $this->_em->flush(); |
|
28 | ||
29 | $user->status = "44"; |
|
30 | $this->_em->flush(); |
|
31 | $this->_em->clear(); |
|
32 | ||
33 | $user = $this->_em->find(CmsUser::class, $user->id); |
|
34 | $this->assertSame("44", $user->status); |
|
35 | } |
|
36 | } |
|
37 |