mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-12 03:30:12 +08:00
Fixes #3168: Improved the performance of yii\rbac\DbManager::checkAccess() by caching mechanism
This commit is contained in:
24
tests/unit/framework/rbac/MySQLManagerCacheTest.php
Normal file
24
tests/unit/framework/rbac/MySQLManagerCacheTest.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace yiiunit\framework\rbac;
|
||||
|
||||
use yii\caching\FileCache;
|
||||
use yii\rbac\DbManager;
|
||||
|
||||
/**
|
||||
* MySQLManagerCacheTest
|
||||
* @group db
|
||||
* @group rbac
|
||||
*/
|
||||
class MySQLManagerCacheTest extends MySQLManagerTest
|
||||
{
|
||||
/**
|
||||
* @return \yii\rbac\ManagerInterface
|
||||
*/
|
||||
protected function createManager()
|
||||
{
|
||||
return new DbManager([
|
||||
'db' => $this->getConnection(),
|
||||
'cache' => new FileCache(['cachePath' => '@yiiunit/runtime/cache']),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user