Example #1
0
 public function testCheckFakePermission()
 {
     $config = Yii::getAlias('@app/tests/_data/rbac/permissions.php');
     $auth = Yii::$app->authManager;
     $permission = $auth->createPermission('test');
     $auth->add($permission);
     expect_that($auth->getPermission('test'));
     $command = new RbacController('test', 'test');
     $command->path = $config;
     $command->beforeAction('test');
     $command->actionUp();
     expect_not($auth->getPermission('test'));
 }