예제 #1
0
 /**
  * @depends writeModelClassWithManyToManyRelation
  * @depends writeAggregateRootClassesFromDomainObject
  *
  *
  * @test
  */
 function writeExtensionFiles()
 {
     $modelName = 'ModelCgt8';
     $relatedModelName = 'RelatedModel';
     $propertyName = 'relNames';
     $domainObject = $this->buildDomainObject($modelName, true, true);
     $relatedDomainObject = $this->buildDomainObject($relatedModelName, true);
     $relation = new Relation\ManyToManyRelation($propertyName);
     $relation->setForeignModel($relatedDomainObject);
     $relation->setInlineEditing(false);
     $domainObject->addProperty($relation);
     $property = new \EBT\ExtensionBuilder\Domain\Model\DomainObject\BooleanProperty('title');
     $domainObject->addProperty($property);
     $this->extension->addDomainObject($domainObject);
     $this->extension->addDomainObject($relatedDomainObject);
     $plugin = new Plugin();
     $plugin->setName('Test');
     $plugin->setKey('test');
     $this->extension->addPlugin($plugin);
     $this->fileGenerator->build($this->extension);
     $extensionDir = $this->extension->getExtensionDir();
     $extensionFiles = array('ext_emconf.php', 'ext_tables.php', 'ext_tables.sql', 'ext_localconf.php');
     foreach ($extensionFiles as $extensionFile) {
         $this->assertFileExists($extensionDir . $extensionFile, 'File was not generated: ' . $extensionFile);
     }
     $this->assertFileExists($extensionDir . 'Configuration/TCA/' . $domainObject->getDatabaseTableName() . '.php');
     $this->assertFileExists($extensionDir . 'Configuration/ExtensionBuilder/settings.yaml');
     $this->assertFileExists($extensionDir . 'Resources/Private/Language/locallang_db.xlf');
     $this->assertFileExists($extensionDir . 'Resources/Private/Language/locallang.xlf');
     $this->assertFileExists($extensionDir . 'Resources/Private/Partials/' . $domainObject->getName() . '/Properties.html');
     $this->assertFileExists($extensionDir . 'Resources/Private/Partials/' . $domainObject->getName() . '/FormFields.html');
 }