/**
  * @test
  * @return void
  */
 public function propertyRenamesFieldIfItMatchesReservedWord()
 {
     $domainObject = $this->buildDomainObject('SomeModel', TRUE, TRUE);
     $property = new \EBT\ExtensionBuilder\Domain\Model\DomainObject\StringProperty();
     $property->setName('Order');
     $property->setDomainObject($domainObject);
     $this->assertEquals('tx_dummy_order', $property->getFieldName());
 }
 /**
  * @test
  */
 public function classBuilderGeneratesGetterMethodForSimpleProperty()
 {
     $domainObject = $this->buildDomainObject($this->modelName, true, true);
     $property0 = new \EBT\ExtensionBuilder\Domain\Model\DomainObject\StringProperty('name');
     $property0->setRequired(TRUE);
     $domainObject->addProperty($property0);
     $modelClassObject = $this->classBuilder->generateModelClassFileObject($domainObject, $this->modelClassTemplatePath, FALSE)->getFirstClass();
     $this->assertTrue($modelClassObject->methodExists('getName'), 'No method: getName');
 }
 /**
  * @test
  */
 public function domainObjectHasExpectedProperties()
 {
     $name = 'MyDomainObject';
     $description = 'My long domain object description';
     $input = array('name' => $name, 'objectsettings' => array('description' => $description, 'aggregateRoot' => TRUE, 'type' => 'Entity'), 'propertyGroup' => array('properties' => array(0 => array('propertyName' => 'name', 'propertyType' => 'String', 'propertyIsRequired' => TRUE), 1 => array('propertyName' => 'type', 'propertyType' => 'Integer'))), 'actionGroup' => array('customActions' => array('test'), 'list' => 1), 'relationGroup' => array());
     $expected = new \EBT\ExtensionBuilder\Domain\Model\DomainObject();
     $expected->setName($name);
     $expected->setDescription($description);
     $expected->setEntity(TRUE);
     $expected->setAggregateRoot(TRUE);
     $property0 = new \EBT\ExtensionBuilder\Domain\Model\DomainObject\StringProperty('name');
     $property0->setRequired(TRUE);
     $property1 = new \EBT\ExtensionBuilder\Domain\Model\DomainObject\IntegerProperty('type');
     $expected->addProperty($property0);
     $expected->addProperty($property1);
     $testAction = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\EBT\ExtensionBuilder\Domain\Model\DomainObject\Action::class);
     $testAction->setName('test');
     $expected->addAction($testAction);
     $listAction = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\EBT\ExtensionBuilder\Domain\Model\DomainObject\Action::class);
     $listAction->setName('list');
     $expected->addAction($listAction);
     $actual = $this->objectSchemaBuilder->build($input);
     $this->assertEquals($actual, $expected, 'Domain Object not built correctly.');
 }