Commit 1a7b4c53 by Carsten Brandt
parent 48d8bdff
......@@ -45,6 +45,18 @@ abstract class ManagerTestCase extends TestCase
// todo: check duplication of name
}
public function testGetChildren()
{
$user = $this->auth->createRole('user');
$this->auth->add($user);
$this->assertCount(0, $this->auth->getChildren($user->name));
$changeName = $this->auth->createPermission('changeName');
$this->auth->add($changeName);
$this->auth->addChild($user, $changeName);
$this->assertCount(1, $this->auth->getChildren($user->name));
}
/*
public function testRemove()
{
......
......@@ -9,7 +9,7 @@ use yii\rbac\PhpManager;
* @group rbac
* @property \yii\rbac\PhpManager $auth
*/
class PhpManagerTestCase extends ManagerTestCase
class PhpManagerTest extends ManagerTestCase
{
protected function setUp()
{
......@@ -32,7 +32,7 @@ class PhpManagerTestCase extends ManagerTestCase
{
$this->prepareData();
$this->auth->save();
$this->auth->clearAll();
$this->auth->removeAll();
$this->auth->load();
// TODO : Check if loaded and saved data are the same.
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment