protected function DrupalWebTestCase::drupalSetContent in SimpleTest 7
Same name and namespace in other branches
- 6.2 drupal_web_test_case.php \DrupalWebTestCase::drupalSetContent()
- 7.2 drupal_web_test_case.php \DrupalWebTestCase::drupalSetContent()
Sets the raw HTML content. This can be useful when a page has been fetched outside of the internal browser and assertions need to be made on the returned page.
A good example would be when testing drupal_http_request(). After fetching the page the content can be set and page elements can be checked to ensure that the function worked properly.
3 calls to DrupalWebTestCase::drupalSetContent()
- DrupalHTTPRequestTestCase::testDrupalHTTPRequest in tests/
common.test - DrupalHTTPRequestTestCase::testDrupalHTTPRequestBasicAuth in tests/
common.test - DrupalWebTestCase::curlExec in ./
drupal_web_test_case.php - Performs a cURL exec with the specified options after calling curlConnect().
File
- ./
drupal_web_test_case.php, line 1961
Class
- DrupalWebTestCase
- Test case for typical Drupal tests.
Code
protected function drupalSetContent($content, $url = 'internal:') {
$this->content = $content;
$this->url = $url;
$this->plainTextContent = FALSE;
$this->elements = FALSE;
}