protected function getServer()
    {
        $servers = array();

        if (isset($this->globals['production']) && (true === $this->globals['production'])) {
            $servers[] = $this->servers['primary'];
            $servers[] = $this->servers['secondary'];
        } else {
            $servers[] = $this->servers['preprod'];
        }

        foreach ($servers as $server) {
            $doc = new \DOMDocument();
            $doc->loadHTML($this->getWebPage(sprintf(
                '%s://%s%s',
                $server['protocol'],
                $server['host'],
                $server['test_path']
            )));
            $element = $doc->getElementById('server_status');

            if ($element && 'OK' == $element->textContent) {
                return $server;
            }
        }

        throw new RuntimeException('No server available.');
    }