public function modificationsOnRetrievedEntitiesAreNotPersistedAutomatically()
{
$this->postRepository = $this->objectManager->get(Fixtures\PostRepository::class);
$post = new Fixtures\Post();
$post->setTitle('Sample');
$this->postRepository->add($post);
$this->persistenceManager->persistAll();
unset($post);
$post = $this->postRepository->findOneByTitle('Sample');
$post->setTitle('Modified Sample');
$this->persistenceManager->persistAll();
unset($post);
$post = $this->postRepository->findOneByTitle('Modified Sample');
$this->assertNull($post);
// The following assertions won't work because findOneByTitle() will get the _modified_ post
// because it is still in Doctrine's identity map:
// $post = $this->postRepository->findOneByTitle('Sample');
// $this->assertNotNull($post);
// $this->assertEquals('Sample', $post->getTitle());
}