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

merge-requests/26/head
Dries Buytaert 2008-08-29 14:45:19 +00:00
parent 395199859d
commit fadcc4f9c1
1 changed files with 7 additions and 0 deletions

View File

@ -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.'));
}
}