File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
app/code/Magento/Authorization
Test/Unit/Model/Acl/Loader Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -75,15 +75,15 @@ public function __construct(
7575 ResourceConnection $ resource ,
7676 CacheInterface $ aclDataCache ,
7777 Json $ serializer ,
78- array $ data = [],
79- string $ cacheKey = self ::ACL_RULE_CACHE_KEY ,
78+ ? array $ data = [],
79+ ? string $ cacheKey = self ::ACL_RULE_CACHE_KEY ,
8080 ?CurrentRoleContext $ roleContext = null
8181 ) {
8282 $ this ->_rootResource = $ rootResource ;
8383 $ this ->_resource = $ resource ;
8484 $ this ->aclDataCache = $ aclDataCache ;
8585 $ this ->serializer = $ serializer ;
86- $ this ->cacheKey = $ cacheKey ;
86+ $ this ->cacheKey = $ cacheKey ?? self :: ACL_RULE_CACHE_KEY ;
8787
8888 $ this ->roleContext = $ roleContext ?? \Magento \Framework \App \ObjectManager::getInstance ()
8989 ->get (CurrentRoleContext::class);
Original file line number Diff line number Diff line change 1414use Magento \Framework \App \ResourceConnection ;
1515use Magento \Framework \Serialize \Serializer \Json ;
1616use PHPUnit \Framework \MockObject \Exception ;
17+ use Magento \Framework \Acl \Role \CurrentRoleContext ;
1718use PHPUnit \Framework \MockObject \MockObject ;
1819use PHPUnit \Framework \TestCase ;
1920
@@ -80,11 +81,16 @@ static function ($value) {
8081 }
8182 );
8283
84+ $ ruleContext = $ this ->createMock (CurrentRoleContext::class);
85+
8386 $ this ->model = new Rule (
8487 $ this ->rootResource ,
8588 $ this ->resourceMock ,
8689 $ this ->aclDataCacheMock ,
87- $ this ->serializerMock
90+ $ this ->serializerMock ,
91+ null ,
92+ null ,
93+ $ ruleContext
8894 );
8995 }
9096
You can’t perform that action at this time.
0 commit comments