aboutsummaryrefslogtreecommitdiffstats
path: root/tests/request/request_class.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2010-10-10 18:39:44 +0200
committerIgor Wiedler <igor@wiedler.ch>2010-10-10 18:39:44 +0200
commita885095897054c91ab68b753ce2a86ae74f2f666 (patch)
tree9adb9074112239838a1a69078702f08e0bcda9be /tests/request/request_class.php
parent9a39f55c24fee8fe817823097e8f596b92ab7049 (diff)
parentc2ffa78521a656b1a183d75c8de2f88624011967 (diff)
downloadforums-a885095897054c91ab68b753ce2a86ae74f2f666.tar
forums-a885095897054c91ab68b753ce2a86ae74f2f666.tar.gz
forums-a885095897054c91ab68b753ce2a86ae74f2f666.tar.bz2
forums-a885095897054c91ab68b753ce2a86ae74f2f666.tar.xz
forums-a885095897054c91ab68b753ce2a86ae74f2f666.zip
Merge branch 'feature/igorw/request-class' into develop
* feature/igorw/request-class: (21 commits) [feature/request-class] Fix mcp.php mode parameter [feature/request-class] Fix remember and session hide on login [feature/request-class] Fix missing include in database_update [feature/request-class] Make additional request test cases run [feature/request-class] Adjust some trailing newlines [feature/request-class] Remove tricky $_* is_array from acp_profile [feature/request-class] Convert any direct access to $_* to use $request [feature/request-class] Add $request to style.php, minor change [feature/request-class] Prevent recursive_set_var from applying htmlspecialchars twice [feature/request-class] Removal of direct access to some superglobals [feature/request-class] Refactor request classes to use autoloading [feature/request-class] Automatically normalize multibyte data in request_var [feature/request-class] Request class test now uses a type cast helper mock. [feature/request-class] Refactored request class and wrapper functions. [feature/request-class] Extracted type casting helpers from the request class. [feature/request-class] Replace direct use of GET/REQUEST with request_var. [feature/request-class] Use the request class in the installer & updater. [feature/request-class] request_var should return after setting the request object. [feature/request-class] Instantiate a global request class instance. [feature/request-class] New request class supports recursive arrays. ...
Diffstat (limited to 'tests/request/request_class.php')
-rw-r--r--tests/request/request_class.php74
1 files changed, 0 insertions, 74 deletions
diff --git a/tests/request/request_class.php b/tests/request/request_class.php
deleted file mode 100644
index e8c2154bab..0000000000
--- a/tests/request/request_class.php
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-/**
-*
-* @package testing
-* @version $Id$
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-define('IN_PHPBB', true);
-
-require_once 'test_framework/framework.php';
-
-require_once '../phpBB/includes/functions.php';
-
-class phpbb_request_request_class_test extends phpbb_test_case
-{
- protected function setUp()
- {
- $_POST['test'] = 1;
- $_GET['test'] = 2;
- $_COOKIE['test'] = 3;
- $_REQUEST['test'] = 3;
-
- // reread data from super globals
- request::reset();
- }
-
- public function test_toggle_super_globals()
- {
- // toggle super globals
- request::disable_super_globals();
- request::enable_super_globals();
-
- $this->assertEquals(1, $_POST['test'], 'Checking $_POST toggling via request::dis/enable_super_globals');
- $this->assertEquals(2, $_GET['test'], 'Checking $_GET toggling via request::dis/enable_super_globals');
- $this->assertEquals(3, $_COOKIE['test'], 'Checking $_COOKIE toggling via request::dis/enable_super_globals');
- $this->assertEquals(3, $_REQUEST['test'], 'Checking $_REQUEST toggling via request::dis/enable_super_globals');
-
- $_POST['x'] = 2;
- $this->assertEquals($_POST, $GLOBALS['_POST'], 'Checking whether $_POST can still be accessed via $GLOBALS[\'_POST\']');
- }
-
- /**
- * Checks that directly accessing $_POST will trigger
- * an error.
- */
- public function test_disable_post_super_global()
- {
- request::disable_super_globals();
-
- $this->setExpectedTriggerError(E_USER_ERROR);
- $_POST['test'] = 3;
- }
-
- public function test_is_set_post()
- {
- $_GET['unset'] = '';
- request::reset();
-
- $this->assertTrue(request::is_set_post('test'));
- $this->assertFalse(request::is_set_post('unset'));
- }
-
- /**
- * Makes sure super globals work properly after these tests
- */
- protected function tearDown()
- {
- request::enable_super_globals();
- request::reset();
- }
-} \ No newline at end of file