public function testQueryErrorHandling() { $this->db->close(); self::assertEquals(false, $this->db->isReady()); $this->invokeMethod($this->db, "queryErrorHandling", array("DB server has gone away", "SELECT * FROM " . $this->tableName . " WHERE page_id = 1")); self::assertEquals(true, $this->db->isReady()); }
/** * Custom close() function * * @return bool */ public function close() { $query = "SELECT RELEASE_LOCK('" . $this->look_name . "')"; // release the lock associated with the current session $this->db->query($query); $this->db->close(); return true; }