public function urlDoesNotRedirect($url)
    {
        if ('/' === $url) {
            $url = '';
        }

        // We must not follow all redirects, so save current situation,
        // force disable follow redirects, and revert at the end.
        $followsRedirects = $this->isFollowingRedirects();
        $this->followRedirects(false);

        $response       = $this->sendHeadAndGetResponse($url);

        if (null !== $response) {
            $responseCode   = $response->getStatus();
            $locationHeader = $response->getHeader('Location', true);

            // Check for 200 response code.
            $this->assertEquals(200, $responseCode, 'Response code was not 200.');

            // Check that destination URL does not try to redirect.
            // Somewhat redundant, as this should never appear with a 200 HTTP Status code anyway.
            $this->assertNull($locationHeader, 'Location header was found when it should not exist.');
        }

        $this->followRedirects($followsRedirects);
    }