예제 #1
0
 public function testEntityCreateAcceptance()
 {
     $entityFile = $this->newFile('PersonEntity.php');
     $entityFile->delete();
     $entityRepositoryFile = $this->newFile('PersonEntityRepository.php');
     $entityRepositoryFile->delete();
     // test
     $builder = new EntityBuilder('Person', $this->module);
     $builder->setWithRepository(TRUE);
     $builder->buildDefaultV2();
     $file = $builder->write($entityFile, EntityBuilder::OVERWRITE);
     $this->assertSame($file, $builder->getWrittenFile());
     $repoFile = $builder->writeRepository($entityRepositoryFile, EntityBuilder::OVERWRITE);
     $this->assertFileEquals($entityFile, $file);
     $this->assertFileEquals($entityRepositoryFile, $repoFile);
     $fixtureEntityFile = $this->getFile('fixture.PersonEntity.php');
     $fixtureEntityRepositoryFile = $this->getFile('fixture.PersonEntityRepository.php');
     $this->assertFileEquals($fixtureEntityFile, $entityFile);
     $this->assertFileEquals($fixtureEntityRepositoryFile, $entityRepositoryFile);
 }