mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding test for ACL node creation with parent ID, disproves #4098
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7026 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
57473a4633
commit
c6e5ed8aba
1 changed files with 14 additions and 0 deletions
|
@ -109,6 +109,20 @@ class AclComponentTest extends CakeTestCase {
|
|||
$this->assertTrue($this->Acl->Aco->save());
|
||||
}
|
||||
|
||||
function testAclCreateWithParent() {
|
||||
$parent = $this->Acl->Aro->findByAlias('Peter', null, null, -1);
|
||||
$this->Acl->Aro->create();
|
||||
$this->Acl->Aro->save(array(
|
||||
'alias' => 'Subordinate',
|
||||
'model' => 'User',
|
||||
'foreign_key' => 7,
|
||||
'parent_id' => $parent['AroTwoTest']['id']
|
||||
));
|
||||
$result = $this->Acl->Aro->findByAlias('Subordinate', null, null, -1);
|
||||
$this->assertEqual($result['AroTwoTest']['lft'], 16);
|
||||
$this->assertEqual($result['AroTwoTest']['rght'], 17);
|
||||
}
|
||||
|
||||
function testDbAclAllow() {
|
||||
$this->assertFalse($this->Acl->check('Micheal', 'tpsReports', 'read'));
|
||||
$this->assertTrue($this->Acl->allow('Micheal', 'tpsReports', array('read', 'delete', 'update')));
|
||||
|
|
Loading…
Reference in a new issue