public function dropDatabase($name)
    {
        if ($this->eventManager->hasListeners(Events::PRE_DROP_DATABASE)) {
            // @codeCoverageIgnoreStart
            $this->eventManager->dispatchEvent(Events::PRE_DROP_DATABASE, new EventArgs($this, $name));
            // @codeCoverageIgnoreEnd
        }

        $response = $this->client->request('DELETE', sprintf('/%s/', urlencode($name)));

        if (404 === $response->getStatusCode()) {
            throw new Exception(sprintf('The database "%s" does not exist', $name));
        }

        $json = (string) $response->getBody();
        $status = JSONEncoder::decode($json);

        if ($this->eventManager->hasListeners(Events::POST_DROP_DATABASE)) {
            // @codeCoverageIgnoreStart
            $this->eventManager->dispatchEvent(Events::POST_DROP_DATABASE, new EventArgs($this, $name));
            // @codeCoverageIgnoreEnd
        }

        return isset($status['ok']) && $status['ok'] === true;
    }