You are a developer and looking for Shopware projects?
Apply Now!
unassignUser example
$this
->
assertSame
(
$new_label
,
$set
->
label
(
)
, 'Shortcut set has been successfully renamed.'
)
;
}
/** * Tests unassigning a shortcut set. */
public
function
testShortcutSetUnassign
(
)
{
$new_set
=
$this
->
generateShortcutSet
(
$this
->
randomMachineName
(
)
)
;
$shortcut_set_storage
= \Drupal::
entityTypeManager
(
)
->
getStorage
(
'shortcut_set'
)
;
$shortcut_set_storage
->
assignUser
(
$new_set
,
$this
->shortcutUser
)
;
$shortcut_set_storage
->
unassignUser
(
$this
->shortcutUser
)
;
$current_set
=
shortcut_current_displayed_set
(
$this
->shortcutUser
)
;
$default_set
=
shortcut_default_set
(
$this
->shortcutUser
)
;
$this
->
assertSame
(
$default_set
->
id
(
)
,
$current_set
->
id
(
)
, "Successfully unassigned another user's shortcut set."
)
;
}
/** * Tests assign clearing on user removal. */
public
function
testShortcutSetUnassignOnUserRemoval
(
)
{
$new_set
=
$this
->
generateShortcutSet
(
$this
->
randomMachineName
(
)
)
;