/**
  * End-of-test cleanup
  */
 protected function tearDown()
 {
     parent::tearDown();
     $this->entityManager->close();
     $this->entityManager = null;
     // avoid memory leaks
 }
Example #2
0
 /**
  * @return array
  */
 private function getMetadataClassesOfEntities()
 {
     $tool = new \Doctrine\ORM\Tools\SchemaTool($this->entityManager);
     $dir = new \DirectoryIterator($this->modelPath);
     $metadatas = array();
     foreach ($dir as $fileinfo) {
         if (!$fileinfo->isDot()) {
             $modelPathInfo = pathinfo($fileinfo->getFilename());
             $entity = 'Orm\\Entity\\' . $modelPathInfo['filename'];
             $metadatas[] = $this->entityManager->getClassMetadata($entity);
         }
     }
     return $metadatas;
 }