From 078b84500b2ee50e600640cfe64e10fdb5be951a Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 15 Oct 2009 09:23:24 -0400 Subject: [PATCH] Adding test from 'Phally' to expand coverage of allow() --- .../cases/libs/controller/components/auth.test.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 45fac1dc6..ecd395c99 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -900,6 +900,16 @@ class AuthTest extends CakeTestCase { $result = $this->Controller->Auth->startup($this->Controller); $this->assertFalse($result, 'startup() should return false, as action is not allowed. %s'); + $url = '/auth_test/delete'; + $this->Controller->params = Router::parse($url); + $this->Controller->params['url']['url'] = Router::normalize($url); + $this->Controller->Auth->initialize($this->Controller); + $this->Controller->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login'); + $this->Controller->Auth->userModel = 'AuthUser'; + + $this->Controller->Auth->allow(array('delete', 'add')); + $result = $this->Controller->Auth->startup($this->Controller); + $this->assertTrue($result, 'startup() should return true, as action is allowed. %s'); } function testAllowedActionsSetWithAllowMethod() { @@ -909,7 +919,6 @@ class AuthTest extends CakeTestCase { $this->Controller->Auth->initialize($this->Controller); $this->Controller->Auth->allow('action_name', 'anotherAction'); $this->assertEqual($this->Controller->Auth->allowedActions, array('action_name', 'anotheraction')); - } /**