public function getServiceContainer() { if (\is_null($this->container)) { $this->container = \HCA_ServiceManager::getInstance()->getContainer(); } return $this->container; }
public function restoreAlertCouchDbState() { $baseUrl = HCA_ServiceManager::getInstance()->getContainer()->getParameter('couchDbBaseUrl'); $couchDbAlert = HCA_ServiceManager::getInstance()->getContainer()->getParameter('couchDbAlert'); if ($couchDbAlert != 'fixtures_alerts') { throw new \Exception("You must use `fixtures_alerts` couch database for testing instead of `{$couchDbAlert}`"); } try { $client = new Client($baseUrl); $response = $client->delete($couchDbAlert)->send(); } catch (\Exception $e) { //echo $e->getMessage(); } return $this; }