/** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. * * @return void */ public function tearDown() { StaticEventManager::resetInstance(); ModuleModel::uninstall(Registry::get('Application')->getServiceManager()->get('CustomModules')->getModule('Social'), ModuleModel::fromName('Social')); parent::tearDown(); }
/** * Uninstall module * * @return \Zend\View\Model\ViewModel */ public function uninstallAction() { $moduleId = $this->getRouteMatch()->getParam('id'); $modules = $this->getServiceLocator()->get('CustomModules'); $moduleModel = ModuleModel::fromId($moduleId); if (!empty($moduleModel)) { $module = $modules->getModule($moduleModel->getName()); if (ModuleModel::uninstall($module, $moduleModel)) { return $this->returnJson(array('success' => true, 'message' => 'Module uninstalled')); } } return $this->returnJson(array('success' => false, 'message' => 'Can\'t uninstall module')); }
/** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. * * @return void */ public function tearDown() { StaticEventManager::resetInstance(); ModuleModel::uninstall(Registry::get('Application')->getServiceManager()->get('CustomModules')->getModule('Blog'), ModuleModel::fromName('Blog')); $this->document->delete(); $this->view->delete(); $this->layout->delete(); $this->documentType->delete(); unset($this->document); unset($this->object); unset($this->view); unset($this->layout); unset($this->documentType); parent::tearDown(); }
/** * Test * * @return void */ public function testInstallAndUninstall() { $modules = Registry::get('Application')->getServiceManager()->get('CustomModules'); Model::uninstall($modules->getModule('Blog'), Model::fromName('Blog')); $this->assertInternalType('integer', (int) Model::install($modules, 'Blog')); $this->assertTrue(Model::uninstall($modules->getModule('Blog'), Model::fromName('Blog'))); }