Chris@18: refreshVariables(); Chris@18: $request_options[RequestOptions::HTTP_ERRORS] = FALSE; Chris@18: $request_options[RequestOptions::ALLOW_REDIRECTS] = FALSE; Chris@18: $request_options = $this->decorateWithXdebugCookie($request_options); Chris@18: $client = $this->getSession()->getDriver()->getClient()->getClient(); Chris@18: return $client->request($method, $url->setAbsolute(TRUE)->toString(), $request_options); Chris@18: } Chris@18: Chris@18: /** Chris@18: * Adds the Xdebug cookie to the request options. Chris@18: * Chris@18: * @param array $request_options Chris@18: * The request options. Chris@18: * Chris@18: * @return array Chris@18: * Request options updated with the Xdebug cookie if present. Chris@18: */ Chris@18: protected function decorateWithXdebugCookie(array $request_options) { Chris@18: $session = $this->getSession(); Chris@18: $driver = $session->getDriver(); Chris@18: if ($driver instanceof BrowserKitDriver) { Chris@18: $client = $driver->getClient(); Chris@18: foreach ($client->getCookieJar()->all() as $cookie) { Chris@18: if (isset($request_options[RequestOptions::HEADERS]['Cookie'])) { Chris@18: $request_options[RequestOptions::HEADERS]['Cookie'] .= '; ' . $cookie->getName() . '=' . $cookie->getValue(); Chris@18: } Chris@18: else { Chris@18: $request_options[RequestOptions::HEADERS]['Cookie'] = $cookie->getName() . '=' . $cookie->getValue(); Chris@18: } Chris@18: } Chris@18: } Chris@18: return $request_options; Chris@18: } Chris@18: Chris@18: }