public function BrowserTestCase::testBrowserBackend in SimpleTest 7
Test general browser functionality.
File
- tests/
browser.test, line 28 - Tests for the internal web browser.
Class
- BrowserTestCase
- Test general browser functionality.
Code
public function testBrowserBackend() {
global $db_prefix;
$browser = new Browser();
$browser
->setUserAgent(drupal_generate_test_ua($db_prefix));
// Check browser refresh, both meta tag and HTTP header.
$request = $browser
->get(url('browser_test/refresh/meta', array(
'absolute' => TRUE,
)));
$this
->assertEqual($request['content'], 'Refresh successful', 'Meta refresh successful ($request)');
$this
->assertEqual($browser
->getContent(), 'Refresh successful', 'Meta refresh successful ($browser)');
$request = $browser
->get(url('browser_test/refresh/header', array(
'absolute' => TRUE,
)));
$this
->assertEqual($request['content'], 'Refresh successful', 'Meta refresh successful ($request)');
$this
->assertEqual($browser
->getContent(), 'Refresh successful', 'Meta refresh successful ($browser)');
}