/**
  * {@inheritdoc}
  */
 public function getAllMetadata()
 {
     if ($logger = $this->getProfilingLogger()) {
         $logger->startGetAllMetadata();
         $result = parent::getAllMetadata();
         $logger->stopGetAllMetadata();
         return $result;
     } else {
         return parent::getAllMetadata();
     }
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function getAllMetadata()
 {
     $logger = $this->getProfilingLogger();
     if ($logger) {
         $logger->startGetAllMetadata();
     }
     $result = parent::getAllMetadata();
     if ($logger) {
         $logger->stopGetAllMetadata();
     }
     return $result;
 }
 /**
  * Create the migration repository data store.
  * @return void
  */
 public function createRepository()
 {
     $this->schema->updateSchema($this->metadata->getAllMetadata());
 }
 public function testGetAllMetadataWorksWithBadConnection()
 {
     // DDC-3551
     $conn = $this->getMockBuilder('Doctrine\\DBAL\\Connection')->disableOriginalConstructor()->getMock();
     $mockDriver = new MetadataDriverMock();
     $em = $this->_createEntityManager($mockDriver, $conn);
     $conn->expects($this->any())->method('getDatabasePlatform')->will($this->throwException(new \Exception('Exception thrown in test when calling getDatabasePlatform')));
     $cmf = new ClassMetadataFactory();
     $cmf->setEntityManager($em);
     // getting all the metadata should work, even if get DatabasePlatform blows up
     $metadata = $cmf->getAllMetadata();
     // this will just be an empty array - there was no error
     $this->assertEquals(array(), $metadata);
 }