@@ 199-208 (lines=10) @@ | ||
196 | $this->assertTrue($updates[0] === $item); |
|
197 | } |
|
198 | ||
199 | public function testGetEntityStateOnVersionedEntityWithAssignedIdentifier() |
|
200 | { |
|
201 | $persister = new EntityPersisterMock($this->_emMock, $this->_emMock->getClassMetadata(VersionedAssignedIdentifierEntity::class)); |
|
202 | $this->_unitOfWork->setEntityPersister(VersionedAssignedIdentifierEntity::class, $persister); |
|
203 | ||
204 | $e = new VersionedAssignedIdentifierEntity(); |
|
205 | $e->id = 42; |
|
206 | $this->assertEquals(UnitOfWork::STATE_NEW, $this->_unitOfWork->getEntityState($e)); |
|
207 | $this->assertFalse($persister->isExistsCalled()); |
|
208 | } |
|
209 | ||
210 | public function testGetEntityStateWithAssignedIdentity() |
|
211 | { |
|
@@ 276-293 (lines=18) @@ | ||
273 | * |
|
274 | * @param mixed $invalidValue |
|
275 | */ |
|
276 | public function testRejectsPersistenceOfObjectsWithInvalidAssociationValue($invalidValue) |
|
277 | { |
|
278 | $this->_unitOfWork->setEntityPersister( |
|
279 | ForumUser::class, |
|
280 | new EntityPersisterMock( |
|
281 | $this->_emMock, |
|
282 | $this->_emMock->getClassMetadata(ForumUser::class) |
|
283 | ) |
|
284 | ); |
|
285 | ||
286 | $user = new ForumUser(); |
|
287 | $user->username = 'John'; |
|
288 | $user->avatar = $invalidValue; |
|
289 | ||
290 | $this->expectException(\Doctrine\ORM\ORMInvalidArgumentException::class); |
|
291 | ||
292 | $this->_unitOfWork->persist($user); |
|
293 | } |
|
294 | ||
295 | /** |
|
296 | * @group DDC-3490 |