Modified relevant test cases to use the refactored SecurityComponent:__methodsRequired

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6699 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
joelmoss 2008-04-18 18:16:20 +00:00
parent 4ced59868a
commit f34ae31184

View file

@ -70,9 +70,9 @@ class SecurityComponentTest extends CakeTestCase {
$this->Controller->action = 'posted';
$this->Controller->Security->startup($this->Controller);
$this->Controller->Security->requirePost('posted');
$this->assertNull($this->Controller->Security->__postRequired($this->Controller));
$this->assertNull($this->Controller->Security->__methodsRequired($this->Controller));
$_SERVER['REQUEST_METHOD'] = 'POST';
$this->assertTrue($this->Controller->Security->__postRequired($this->Controller));
$this->assertTrue($this->Controller->Security->__methodsRequired($this->Controller));
}
function testRequireGet()
@ -80,9 +80,9 @@ class SecurityComponentTest extends CakeTestCase {
$this->Controller->action = 'getted';
$this->Controller->Security->startup($this->Controller);
$this->Controller->Security->requireGet('getted');
$this->assertNull($this->Controller->Security->__getRequired($this->Controller));
$this->assertNull($this->Controller->Security->__methodsRequired($this->Controller));
$_SERVER['REQUEST_METHOD'] = 'GET';
$this->assertTrue($this->Controller->Security->__getRequired($this->Controller));
$this->assertTrue($this->Controller->Security->__methodsRequired($this->Controller));
}
function testRequirePut()
@ -90,9 +90,9 @@ class SecurityComponentTest extends CakeTestCase {
$this->Controller->action = 'putted';
$this->Controller->Security->startup($this->Controller);
$this->Controller->Security->requirePut('putted');
$this->assertNull($this->Controller->Security->__putRequired($this->Controller));
$this->assertNull($this->Controller->Security->__methodsRequired($this->Controller));
$_SERVER['REQUEST_METHOD'] = 'PUT';
$this->assertTrue($this->Controller->Security->__putRequired($this->Controller));
$this->assertTrue($this->Controller->Security->__methodsRequired($this->Controller));
}
function testRequireDelete()
@ -100,9 +100,9 @@ class SecurityComponentTest extends CakeTestCase {
$this->Controller->action = 'deleted';
$this->Controller->Security->startup($this->Controller);
$this->Controller->Security->requireDelete('deleted');
$this->assertNull($this->Controller->Security->__deleteRequired($this->Controller));
$this->assertNull($this->Controller->Security->__methodsRequired($this->Controller));
$_SERVER['REQUEST_METHOD'] = 'DELETE';
$this->assertTrue($this->Controller->Security->__deleteRequired($this->Controller));
$this->assertTrue($this->Controller->Security->__methodsRequired($this->Controller));
}
function testValidatePostNoModel() {