MINOR Fixed HTTPRequest class usage (regression from r113293)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@113298 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-11-01 02:57:57 +00:00 committed by Sam Minnee
parent b305ea0fc0
commit 79bc6d5a21

View File

@ -71,19 +71,19 @@ class SecurityTokenTest extends SapphireTest {
$n = $t->getName();
$t->setValue(null);
$r = new SS_HTTPRequest('GET', 'dummy', array($n => 'invalidtoken'));
$r = new HTTPRequest('GET', 'dummy', array($n => 'invalidtoken'));
$this->assertFalse($t->checkRequest($r), 'Any token is invalid if no token is stored');
$t->setValue(null);
$r = new SS_HTTPRequest('GET', 'dummy', array($n => null));
$r = new HTTPRequest('GET', 'dummy', array($n => null));
$this->assertFalse($t->checkRequest($r), 'NULL token is invalid if no token is stored');
$t->setValue('mytoken');
$r = new SS_HTTPRequest('GET', 'dummy', array($n => 'invalidtoken'));
$r = new HTTPRequest('GET', 'dummy', array($n => 'invalidtoken'));
$this->assertFalse($t->checkRequest($r), 'Invalid token returns false');
$t->setValue('mytoken');
$r = new SS_HTTPRequest('GET', 'dummy', array($n => 'mytoken'));
$r = new HTTPRequest('GET', 'dummy', array($n => 'mytoken'));
$this->assertTrue($t->checkRequest($r), 'Valid token returns true');
}