You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
602 B
34 lines
602 B
12 years ago
|
<?php
|
||
|
|
||
|
namespace yiiunit\framework\rbac;
|
||
|
|
||
|
use yii\rbac\PhpManager;
|
||
|
|
||
|
require_once(__DIR__ . '/ManagerTestBase.php');
|
||
|
|
||
|
class PhpManagerTest extends ManagerTestBase
|
||
|
{
|
||
|
public function setUp()
|
||
|
{
|
||
|
$authFile = \Yii::$app->getRuntimePath() . '/rbac.php';
|
||
|
@unlink($authFile);
|
||
|
$this->auth = new PhpManager;
|
||
|
$this->auth->authFile = $authFile;
|
||
|
$this->auth->init();
|
||
|
$this->prepareData();
|
||
|
}
|
||
|
|
||
|
public function tearDown()
|
||
|
{
|
||
|
@unlink($this->auth->authFile);
|
||
|
}
|
||
|
|
||
|
public function testSaveLoad()
|
||
|
{
|
||
|
$this->auth->save();
|
||
|
$this->auth->clearAll();
|
||
|
$this->auth->load();
|
||
|
$this->testCheckAccess();
|
||
|
}
|
||
|
}
|