public function testExtendLoadMetadataForClass()
 {
     $doctrineClassMetadata = $this->em->getClassMetadata('Oro\\Bundle\\DataAuditBundle\\Tests\\Unit\\Fixture\\LoggableClass');
     $metadata = $this->loggableAnnotationDriver->extendLoadMetadataForClass($doctrineClassMetadata);
     $metadataFactory = new ExtendMetadataFactory($this->loggableAnnotationDriver);
     $resultMetadata = $metadataFactory->extendLoadMetadataForClass($doctrineClassMetadata);
     $metadata->createdAt = $resultMetadata->createdAt;
     $this->assertEquals($metadata, $resultMetadata);
 }
예제 #2
0
 /**
  * @param LoadClassMetadataEventArgs $event
  */
 public function loadClassMetadata(LoadClassMetadataEventArgs $event)
 {
     if ($event->getClassMetadata()->getReflectionClass() && ($metadata = $this->metadataFactory->extendLoadMetadataForClass($event->getClassMetadata()))) {
         $this->loggableManager->addConfig($metadata);
     }
 }