public function setUp()
 {
     $metadata = $this->da->getMetadata();
     $this->assertNotEmpty($metadata);
     $this->assertInstanceOf(\Doctrine\Common\Persistence\Mapping\ClassMetadata::class, reset($metadata));
     $this->map = $this->da->analyze();
     $this->assertTrue(is_array($this->map));
 }
Beispiel #2
0
 public function setUp()
 {
     $data = file_get_contents(__DIR__ . '/example-metadata');
     //$params = array('url' => 'mysql://*****:*****@localhost:33060/drapo');
     //$connection = \Doctrine\DBAL\DriverManager::getConnection($params);
     //$config = Setup::createConfiguration();
     //    *     $paths = array('/path/to/entity/mapping/files');
     //    *     $config = Setup::createAnnotationMetadataConfiguration($paths);
     //$entityManager = EntityManager::create($connection, $config);
     $this->da = new DoctrineAnalyzer();
     //$this->da->setEntityManager($entityManager);
     $this->da->setMetadata(unserialize($data));
     $this->collections = $this->da->analyze();
     $this->map = new Apimap($this->collections);
 }
 /**
  * @return ForestCollection[]
  */
 protected function getCollectionsFromAnalyzer()
 {
     //$this->orm can currently only be the Doctrine service
     $em = $this->getOrm()->getEntityManager();
     $analyzer = new DoctrineAnalyzer();
     $analyzer->setEntityManager($em);
     return $analyzer->analyze();
 }