Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
onAclRoleLoaded example
$this
->
deactivatePlugin
(
self::PLUGIN_ACL_PRODUCT_VIEWER
)
;
$aclRoles
=
[
$this
->
getAclRoleMock
(
'pluginAclTestProductViewer',
[
'product.viewer', 'product:read'
]
)
]
;
$event
=
new
EntityLoadedEvent
(
$this
->
createMock
(
AclRoleDefinition::
class
)
,
$aclRoles
,
Context::
createDefaultContext
(
)
)
;
$this
->pluginAclSubscriber->
onAclRoleLoaded
(
$event
)
;
/** @var AclRoleEntity $enrichedAclRole */
$enrichedAclRole
=
$event
->
getEntities
(
)
[
0
]
;
static
::
assertSame
(
[
'product.viewer', 'product:read'
]
,
$enrichedAclRole
->
getPrivileges
(
)
)
;
}
public
function
testAclPluginActivated
(
)
: void
{
$this
->
activatePlugin
(
self::PLUGIN_ACL_PRODUCT_VIEWER
)
;