mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-13 12:49:04 +08:00
@@ -45,6 +45,18 @@ abstract class ManagerTestCase extends TestCase
|
|||||||
|
|
||||||
// todo: check duplication of name
|
// 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()
|
public function testRemove()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use yii\rbac\PhpManager;
|
|||||||
* @group rbac
|
* @group rbac
|
||||||
* @property \yii\rbac\PhpManager $auth
|
* @property \yii\rbac\PhpManager $auth
|
||||||
*/
|
*/
|
||||||
class PhpManagerTestCase extends ManagerTestCase
|
class PhpManagerTest extends ManagerTestCase
|
||||||
{
|
{
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
@@ -32,7 +32,7 @@ class PhpManagerTestCase extends ManagerTestCase
|
|||||||
{
|
{
|
||||||
$this->prepareData();
|
$this->prepareData();
|
||||||
$this->auth->save();
|
$this->auth->save();
|
||||||
$this->auth->clearAll();
|
$this->auth->removeAll();
|
||||||
$this->auth->load();
|
$this->auth->load();
|
||||||
// TODO : Check if loaded and saved data are the same.
|
// TODO : Check if loaded and saved data are the same.
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user