You are here

public function BrowserPageTestCase::testBrowserPage in SimpleTest 7

Check "BrowserPage" class functionality.

File

tests/browser.test, line 110
Tests for the internal web browser.

Class

BrowserPageTestCase
Test browser page manipulation functionality.

Code

public function testBrowserPage() {
  global $db_prefix;
  $browser = new Browser();
  $browser
    ->setUserAgent(drupal_generate_test_ua($db_prefix));
  $browser
    ->get(url('browser_test/print/post', array(
    'absolute' => TRUE,
  )));
  $page = $browser
    ->getPage();
  $input = $page
    ->xpath('//input[@name="foo"]');
  $input = $input[0];
  $this
    ->assertEqual('foo', $input['name'], t('Field "foo" found'));
}