setEmbeddedValueObject() 공개 메소드

public setEmbeddedValueObject ( TestEmbeddedValueObject $embeddedValueObject ) : void
$embeddedValueObject TestEmbeddedValueObject
리턴 void
 /**
  * @test
  */
 public function embeddedValueObjectsAreActuallyEmbedded()
 {
     /* @var $entityManager ObjectManager */
     $entityManager = $this->objectManager->get(ObjectManager::class);
     $schemaTool = new SchemaTool($entityManager);
     $classMetaData = $entityManager->getClassMetadata(Fixtures\TestEntity::class);
     $this->assertTrue($classMetaData->hasField('embeddedValueObject.value'), 'ClassMetadata is not correctly embedded');
     $schema = $schemaTool->getSchemaFromMetadata(array($classMetaData));
     $this->assertTrue($schema->getTable('persistence_testentity')->hasColumn('embeddedvalueobjectvalue'), 'Database schema is missing embedded field');
     $valueObject = new Fixtures\TestEmbeddedValueObject('someValue');
     $testEntity = new Fixtures\TestEntity();
     $testEntity->setEmbeddedValueObject($valueObject);
     $this->testEntityRepository->add($testEntity);
     $this->persistenceManager->persistAll();
     $this->persistenceManager->clearState();
     /* @var $testEntity Fixtures\TestEntity */
     $testEntity = $this->testEntityRepository->findAll()->getFirst();
     $this->assertEquals('someValue', $testEntity->getEmbeddedValueObject()->getValue());
 }