protected function OAuth2ServerTestCase::httpRequest in OAuth2 Server 7
Performs a drupal_http_request() with additional parameters.
Passes along all cookies. This ensures that the test user has access to the oauth2 endpoints.
Parameters
$url: $url: A string containing a fully qualified URI.
$options: The options array passed along to drupal_http_request().
Return value
The result object as returned by drupal_http_request().
14 calls to OAuth2ServerTestCase::httpRequest()
- OAuth2ServerTestCase::authorizationCodeRequest in tests/
oauth2_server.test - Performs an authorization request and returns it.
- OAuth2ServerTestCase::passwordGrantRequest in tests/
oauth2_server.test - Performs a password grant request and returns it.
- OAuth2ServerTestCase::testAuthorizationCodeGrantType in tests/
oauth2_server.test - Tests the "Authorization code" grant type.
- OAuth2ServerTestCase::testBlockedUserTokenFails in tests/
oauth2_server.test - Test that access is denied when using a token for a blocked user.
- OAuth2ServerTestCase::testClientCredentialsGrantType in tests/
oauth2_server.test - Tests the "Client credentials" grant type.
File
- tests/
oauth2_server.test, line 779 - OAuth2 tests.
Class
- OAuth2ServerTestCase
- Test basic API.
Code
protected function httpRequest($url, array $options = array()) {
// Forward cookies.
$cookie_string = '';
foreach ($this->cookies as $name => $data) {
$cookie_string .= $name . '=' . $data['value'] . ';';
}
$options['headers']['Cookie'] = $cookie_string;
// Set other general options.
$options += array(
'max_redirects' => 0,
);
return drupal_http_request($url, $options);
}