updating auth test, closes #4398

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6620 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2008-04-02 15:56:19 +00:00
parent af2228216f
commit 1346224b1f

View file

@ -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');