Beispiel #1
0
 /**
  * @test
  * @group library
  */
 public function test_getById_success()
 {
     // ARRANGE
     $dao = $this->createModuleDao();
     $sources = $this->getModuleSourceItemsFromGlobalSetAndPackage('module_test', 'rz_testing');
     $moduleSource = new ModuleSource($this->websiteId, $sources);
     $expectedModuleId = 'rz_tests_module_only_global';
     $expectedModule = new DataModule();
     $expectedModule->setSourceType(DataModule::SOURCE_REPOSITORY);
     $expectedModule->setOverwritten(false);
     $expectedModule->setId($expectedModuleId);
     $expectedModule->setName('this is the name: rz_tests_module_only_global (global)');
     $expectedModule->setDescription('');
     $expectedModule->setVersion('test');
     $expectedModule->setIcon('application.png');
     $expectedModule->setCategory('{"de":"Default Module","en":"Default Modules"}');
     $expectedModule->setModuletype('default');
     $expectedModule->setAllowedchildmoduletype('*');
     $expectedModule->setRerenderrequired(true);
     $expectedModule->setApiType('APIv1');
     $expectedModule->setSessionRequired(true);
     // ACT
     $module = $dao->getById($moduleSource, $expectedModuleId);
     // ASSERT
     $this->assertSame($expectedModule->getId(), $module->getId());
     $this->assertSame($expectedModule->getSourceType(), $module->getSourceType());
     $this->assertSame($expectedModule->isOverwritten(), $module->isOverwritten());
     $this->assertSame($expectedModule->getName(), $module->getName());
     $this->assertSame($expectedModule->getDescription(), $module->getDescription());
     $this->assertSame($expectedModule->getVersion(), $module->getVersion());
     $this->assertSame($expectedModule->getIcon(), $module->getIcon());
     $this->assertSame($expectedModule->getCategory(), $module->getCategory());
     $this->assertSame($expectedModule->getModuletype(), $module->getModuletype());
     $this->assertSame($expectedModule->getAllowedchildmoduletype(), $module->getAllowedchildmoduletype());
     $this->assertSame($expectedModule->getRerenderrequired(), $module->getRerenderrequired());
     $this->assertSame($expectedModule->getApiType(), $module->getApiType());
     $this->assertSame($expectedModule->getSessionRequired(), $module->getSessionRequired());
 }
Beispiel #2
0
 /**
  * @param string     $moduleDataDirectory
  * @param string     $fileName
  * @param DataModule $module
  */
 protected function writeModuleManifestFile($moduleDataDirectory, $fileName, DataModule $module)
 {
     $moduleManifest = new \stdClass();
     $moduleManifest->name = $module->getName();
     $moduleManifest->description = $module->getDescription();
     $moduleManifest->version = $module->getVersion();
     $moduleManifest->icon = $module->getIcon();
     $moduleManifest->category = $module->getCategory();
     $moduleManifest->moduleType = $module->getModuletype();
     $moduleManifest->allowedChildModuleType = $module->getAllowedchildmoduletype();
     $moduleManifest->reRenderRequired = $module->getRerenderrequired();
     $moduleManifest->ghostContainerMode = $module->getGhostContainerMode();
     $moduleManifest->apiType = $module->getApiType();
     $moduleManifest->sessionRequired = $module->getSessionRequired();
     $this->storeJsonFile($moduleDataDirectory, $fileName, $moduleManifest);
 }
Beispiel #3
0
 /**
  * @param $data
  */
 protected function setValuesFromData(Data\Modul $data)
 {
     $this->setId($data->getId());
     $this->setWebsiteid($data->getWebsiteId());
     $this->setName($data->getName());
     $this->setDescription($data->getDescription());
     $this->setVersion($data->getVersion());
     $this->setIcon($data->getIcon());
     $this->setForm($data->getForm());
     $this->setFormvalues($data->getFormvalues());
     $this->setCategory($data->getCategory());
     $this->setModuletype($data->getModuletype());
     $this->setAllowedchildmoduletype($data->getAllowedchildmoduletype());
     $this->setReRenderRequired($data->getRerenderrequired());
     $this->setSourceType($data->getSourceType());
     $this->setOverwritten($data->isOverwritten());
     $this->setGhostContainerMode($data->getGhostContainerMode());
 }