From 1346224b1fc71ee1895cdbdd1e4e5368de2bd20c Mon Sep 17 00:00:00 2001 From: gwoo Date: Wed, 2 Apr 2008 15:56:19 +0000 Subject: [PATCH] updating auth test, closes #4398 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6620 3807eeeb-6ff5-0310-8944-8be069107fe0 --- .../libs/controller/components/auth.test.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 7c75f300d..5119b61cf 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -258,27 +258,28 @@ class AuthTest extends CakeTestCase { $result = $this->Controller->Acl->Aro->save(); $this->assertTrue($result); - $this->Controller->Acl->Aro->create(array('alias'=>'Admin')); + $parent = $this->Controller->Acl->Aro->id; + + $this->Controller->Acl->Aro->create(array('parent_id'=> $parent, 'alias'=>'Admin')); $result = $this->Controller->Acl->Aro->save(); $this->assertTrue($result); - $this->Controller->Acl->Aro->create(array('model'=>'AuthUser', 'foreign_key'=>'1', 'alias'=> 'mariano')); + $parent = $this->Controller->Acl->Aro->id; + + $this->Controller->Acl->Aro->create(array('model' => 'AuthUser', 'parent_id' => $parent, 'foreign_key' => 1, 'alias'=> 'mariano')); $result = $this->Controller->Acl->Aro->save(); $this->assertTrue($result); - $this->Controller->Acl->Aro->setParent(1, 2); - $this->Controller->Acl->Aro->setParent(2, 3); - $this->Controller->Acl->Aco->create(array('alias'=>'Root')); $result = $this->Controller->Acl->Aco->save(); $this->assertTrue($result); - $this->Controller->Acl->Aco->create(array('alias'=>'AuthTest')); + $parent = $this->Controller->Acl->Aco->id; + + $this->Controller->Acl->Aco->create(array('parent_id' => $parent, 'alias' => 'AuthTest')); $result = $this->Controller->Acl->Aco->save(); $this->assertTrue($result); - $this->Controller->Acl->Aco->setParent(1, 2); - $this->Controller->Acl->allow('Roles/Admin', 'Root'); $this->Controller->Acl->allow('Roles/Admin', 'Root/AuthTest');