public function disconnect($force = false) { if (!$this->connectWasCalled) { // if we never actually connected, we don't have to actually disconnect return true; } return $this->conn->disconnect($force); }
public function testConnectionError() { $this->redis->disconnect(); try { $this->redis->get('anything'); $this->fail('Getting from a non connected redis should throw a ConnectionError'); } catch (ConnectionError $e) { // everything is fine here } }