- Patch #295564 by mustafau, Damien Tournoud et al: drupal_http_rqeuest triggers error.
parent
395199859d
commit
fadcc4f9c1
|
@ -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.'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue