aboutsummaryrefslogtreecommitdiffstats
path: root/tests/security/redirect.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2011-01-10 00:18:37 +0100
committerIgor Wiedler <igor@wiedler.ch>2011-01-10 00:18:37 +0100
commit01fe91c5c4e897801f5c179cd4060e686762f105 (patch)
tree178535f1cecfa2fd5748b21f9d59d1d471d1bd35 /tests/security/redirect.php
parent0a945100fd285658f1c3c936d413939eb11a6e16 (diff)
downloadforums-01fe91c5c4e897801f5c179cd4060e686762f105.tar
forums-01fe91c5c4e897801f5c179cd4060e686762f105.tar.gz
forums-01fe91c5c4e897801f5c179cd4060e686762f105.tar.bz2
forums-01fe91c5c4e897801f5c179cd4060e686762f105.tar.xz
forums-01fe91c5c4e897801f5c179cd4060e686762f105.zip
[ticket/9987] Rename test files to include a _test suffix
PHPBB3-9987
Diffstat (limited to 'tests/security/redirect.php')
-rw-r--r--tests/security/redirect.php60
1 files changed, 0 insertions, 60 deletions
diff --git a/tests/security/redirect.php b/tests/security/redirect.php
deleted file mode 100644
index c53414e7df..0000000000
--- a/tests/security/redirect.php
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-/**
-*
-* @package testing
-* @copyright (c) 2008 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-require_once __DIR__ . '/base.php';
-
-require_once __DIR__ . '/../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../phpBB/includes/session.php';
-
-class phpbb_security_redirect_test extends phpbb_security_test_base
-{
- public static function provider()
- {
- // array(Input -> redirect(), expected triggered error (else false), expected returned result url (else false))
- return array(
- array('data://x', false, 'http://localhost/phpBB'),
- array('bad://localhost/phpBB/index.php', 'Tried to redirect to potentially insecure url.', false),
- array('http://www.otherdomain.com/somescript.php', false, 'http://localhost/phpBB'),
- array("http://localhost/phpBB/memberlist.php\n\rConnection: close", 'Tried to redirect to potentially insecure url.', false),
- array('javascript:test', false, 'http://localhost/phpBB/../javascript:test'),
- array('http://localhost/phpBB/index.php;url=', 'Tried to redirect to potentially insecure url.', false),
- );
- }
-
- protected function setUp()
- {
- parent::setUp();
-
- $GLOBALS['config'] = array(
- 'force_server_vars' => '0',
- );
- }
-
- /**
- * @dataProvider provider
- */
- public function test_redirect($test, $expected_error, $expected_result)
- {
- global $user;
-
- if ($expected_error !== false)
- {
- $this->setExpectedTriggerError(E_USER_ERROR, $expected_error);
- }
-
- $result = redirect($test, true);
-
- // only verify result if we did not expect an error
- if ($expected_error === false)
- {
- $this->assertEquals($expected_result, $result);
- }
- }
-}
-