/** * @test * @group library */ public function deleteByIdShouldDeleteOverwrittenLocalModuleEvenIfTemplateAssociatedToModule() { // ARRANGE $websiteId = $this->websiteIdWithLocalAndGlobalModules; $localAndGlobalModuleId = 'rz_tests_module_local_and_global'; // ACT $this->service->delete($localAndGlobalModuleId, $websiteId); $module = $this->service->getById($localAndGlobalModuleId, $websiteId); // ASSERT $this->assertInstanceOf('\\Cms\\Data\\Modul', $module); $this->assertEquals($localAndGlobalModuleId, $module->getId()); $this->assertFalse($module->isOverwritten()); }
/** * @param \Cms\Service\Modul $moduleService * @param string $websiteId * @param DataModule $module * * @return DataModule */ protected function createOrOverwriteModule($moduleService, $websiteId, DataModule $module) { if ($moduleService->existsModulAlready($module->getId(), $websiteId, true)) { $moduleService->delete($module->getId(), $websiteId); } return $moduleService->create($websiteId, $module); }