mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
b305ea0fc0
commit
79bc6d5a21
@ -71,19 +71,19 @@ class SecurityTokenTest extends SapphireTest {
|
|||||||
$n = $t->getName();
|
$n = $t->getName();
|
||||||
|
|
||||||
$t->setValue(null);
|
$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');
|
$this->assertFalse($t->checkRequest($r), 'Any token is invalid if no token is stored');
|
||||||
|
|
||||||
$t->setValue(null);
|
$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');
|
$this->assertFalse($t->checkRequest($r), 'NULL token is invalid if no token is stored');
|
||||||
|
|
||||||
$t->setValue('mytoken');
|
$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');
|
$this->assertFalse($t->checkRequest($r), 'Invalid token returns false');
|
||||||
|
|
||||||
$t->setValue('mytoken');
|
$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');
|
$this->assertTrue($t->checkRequest($r), 'Valid token returns true');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user