Skip to content
Snippets Groups Projects
Commit fadcc4f9 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #295564 by mustafau, Damien Tournoud et al: drupal_http_rqeuest triggers error.

parent 39519985
No related branches found
No related tags found
No related merge requests found
......@@ -130,10 +130,17 @@ class DrupalHTTPRequestTestCase extends DrupalWebTestCase {
}
function testDrupalHTTPRequest() {
// Parse URL schema.
$missing_scheme = drupal_http_request('example.com/path');
$this->assertEqual($missing_scheme->error, 'missing schema', t('Returned with missing scheme error.'));
$unable_to_parse = drupal_http_request('http:///path');
$this->assertEqual($unable_to_parse->error, 'unable to parse URL', t('Returned with unable to parse URL error.'));
// Fetch page.
$result = drupal_http_request(url('node', array('absolute' => TRUE)));
$this->assertEqual($result->code, 200, t('Fetched page successfully.'));
$this->drupalSetContent($result->data);
$this->assertTitle(variable_get('site_name', 'Drupal'), t('Site title matches.'));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment