public function valueObjectsWithTheSameValueAreOnlyPersistedOnce()
{
$valueObject1 = new Fixtures\TestValueObject('sameValue');
$valueObject2 = new Fixtures\TestValueObject('sameValue');
$testEntity1 = new Fixtures\TestEntity();
$testEntity1->setRelatedValueObject($valueObject1);
$testEntity2 = new Fixtures\TestEntity();
$testEntity2->setRelatedValueObject($valueObject2);
$this->testEntityRepository->add($testEntity1);
$this->testEntityRepository->add($testEntity2);
$this->persistenceManager->persistAll();
$this->persistenceManager->clearState();
$testEntities = $this->testEntityRepository->findAll();
$this->assertSame($testEntities[0]->getRelatedValueObject(), $testEntities[1]->getRelatedValueObject());
}