From 3316731dd9d9d693280eab39b4200f7e2f00e59a Mon Sep 17 00:00:00 2001 From: nate Date: Wed, 27 Feb 2008 03:57:33 +0000 Subject: [PATCH] Updating ACL component test case, disproves ticket #4190 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6478 3807eeeb-6ff5-0310-8944-8be069107fe0 --- .../cases/libs/controller/components/acl.test.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/controller/components/acl.test.php b/cake/tests/cases/libs/controller/components/acl.test.php index 9fc7807bb..6f7e4f51d 100644 --- a/cake/tests/cases/libs/controller/components/acl.test.php +++ b/cake/tests/cases/libs/controller/components/acl.test.php @@ -252,7 +252,16 @@ class AclComponentTest extends CakeTestCase { $result = $this->Acl->check('Secretary', 'Links', 'delete'); $this->assertTrue($result); - $this->Acl->deny('Secretary','Links',array('delete')); + $this->Acl->allow('Secretary','Links','read'); + $result = $this->Acl->Aro->Permission->find('all', array('conditions' => array('AroTest.alias' => 'Secretary'))); + $expected = array('id' => '2', 'aro_id' => '4', 'aco_id' => '15', '_create' => '1', '_read' => '1', '_update' => '', '_delete' => ''); + $this->assertEqual($result[0]['PermissionTest'], $expected); + + $this->Acl->deny('Secretary','Links','delete'); + $expected['_delete'] = '-1'; + $result = $this->Acl->Aro->Permission->find('all', array('conditions' => array('AroTest.alias' => 'Secretary'))); + $this->assertEqual($result[0]['PermissionTest'], $expected); + $result = $this->Acl->check('Secretary','Links','delete'); $this->assertFalse($result);