summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/browser.test
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-11-07 14:10:33 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-11-07 14:10:33 +0000
commit35ff7005f4bb751e19509a3d9887d2fc455fada9 (patch)
treedd6e0cc1f7309883be0a1c0686fbb0075f3e5a48 /modules/simpletest/tests/browser.test
parent74722b8a1467740d0fafaf431b6a326cfbe0d9eb (diff)
downloadbrdo-35ff7005f4bb751e19509a3d9887d2fc455fada9.tar.gz
brdo-35ff7005f4bb751e19509a3d9887d2fc455fada9.tar.bz2
#600032 by c960657: Removed browser.inc. Please see http://drupal.org/project/browser if you'd like to help with a more fleshed-out abstract browser for possible inclusion in D8.
Diffstat (limited to 'modules/simpletest/tests/browser.test')
-rw-r--r--modules/simpletest/tests/browser.test123
1 files changed, 0 insertions, 123 deletions
diff --git a/modules/simpletest/tests/browser.test b/modules/simpletest/tests/browser.test
deleted file mode 100644
index f22f7b838..000000000
--- a/modules/simpletest/tests/browser.test
+++ /dev/null
@@ -1,123 +0,0 @@
-<?php
-// $Id$
-
-/**
- * @file
- * Tests for the internal web browser.
- */
-
-/**
- * Test general browser functionality.
- */
-class BrowserTestCase extends DrupalWebTestCase {
-
- public static function getInfo() {
- return array(
- 'name' => 'Browser',
- 'description' => 'Test general browser functionality.',
- 'group' => 'Browser',
- );
- }
-
- public function setUp() {
- parent::setUp('browser_test');
- }
-
- /**
- * Test general browser functionality.
- */
- 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)');
- }
-}
-
-/**
- * Test browser backend wrappers.
- */
-class BrowserBackendTestCase extends DrupalWebTestCase {
-
- public static function getInfo() {
- return array(
- 'name' => 'Browser - wrapper backends',
- 'description' => 'Test stream and curl backends execution of GET and POST requests.',
- 'group' => 'Browser',
- );
- }
-
- public function setUp() {
- parent::setUp('browser_test');
- }
-
- /**
- * Test stream and curl backends execution of GET and POST requests.
- */
- public function testBrowserBackend() {
- global $db_prefix;
-
- foreach (array('stream', 'curl') as $wrapper) {
- $browser = new Browser($wrapper == 'stream');
- $browser->setUserAgent(drupal_generate_test_ua($db_prefix));
-
- $string = $this->randomName();
- $edit = array(
- 'foo' => $string,
- );
-
- // Test GET method.
- $request = $browser->get(url('browser_test/print/get', array('absolute' => TRUE, 'query' => $edit)));
- $this->assertEqual($string, $request['content'], t('String found during GET request ($request)'), $wrapper);
- $this->assertEqual($string, $browser->getContent(), t('String found during GET request ($browser)'), $wrapper);
-
- // Test POST method.
- $request = $browser->post(url('browser_test/print/post', array('absolute' => TRUE)), $edit, t('Submit'));
- $this->assertEqual($string, $request['content'], t('String found during POST request ($request)'), $wrapper);
- $this->assertEqual($string, $browser->getContent(), t('String found during POST request ($browser)'), $wrapper);
- }
- }
-}
-
-/**
- * Test browser page manipulation functionality.
- */
-class BrowserPageTestCase extends DrupalWebTestCase {
-
- public static function getInfo() {
- return array(
- 'name' => 'Browser - page',
- 'description' => 'Check "BrowserPage" class functionality.',
- 'group' => 'Browser',
- );
- }
-
- public function setUp() {
- parent::setUp('browser_test');
- }
-
- /**
- * Check "BrowserPage" class functionality.
- */
- 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'));
- }
-}