/** * Deactivate an organization of type customer */ public function deactivateAction() { if (!$this->getRequest()->isPost()) { throw new AppEx\UnexpectedException("Resquest must be POST"); } $org = $this->_getOrganization(); // Check permissions $this->_helper->allowed('deactivate', $org); // Fix customer if (isset($org->trialDuration)) { unset($org->trialDuration); } $result = $this->_orgSrv->deactivate($org); $this->view->data = $result; }
public function testOrgCustomerActivation() { $this->_service->deactivate(self::CUSTOMER_ORG_ID); $result = $this->_service->activate(self::CUSTOMER_ORG_ID); $this->assertNotNull($result); $this->assertEquals($result, self::CUSTOMER_ORG_ID); }
public function testActivate() { // Persist the org model $this->_org->save(); $this->_service->deactivate($this->_org->getId()); $org = $this->_service->load($this->_org->getId()); $this->assertEquals($org->status, OrgAggregatorModel::ORG_STATUS_DEACTIVATED); $this->_service->activate($this->_org->getId()); $org = $this->_service->load($this->_org->getId()); $this->assertEquals($org->status, OrgAggregatorModel::ORG_STATUS_ACTIVATED); }