diff options
Diffstat (limited to 'modules/shortcut')
-rw-r--r-- | modules/shortcut/shortcut.module | 2 | ||||
-rw-r--r-- | modules/shortcut/shortcut.test | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/modules/shortcut/shortcut.module b/modules/shortcut/shortcut.module index d2ac72b32..8642d9de7 100644 --- a/modules/shortcut/shortcut.module +++ b/modules/shortcut/shortcut.module @@ -460,7 +460,7 @@ function shortcut_set_assign_user($shortcut_set, $account) { * to any set. */ function shortcut_set_unassign_user($account) { - $deleted = db_delete('shortcut_set') + $deleted = db_delete('shortcut_set_users') ->condition('uid', $account->uid) ->execute(); return (bool) $deleted; diff --git a/modules/shortcut/shortcut.test b/modules/shortcut/shortcut.test index e37e1e5f8..75a5a67bf 100644 --- a/modules/shortcut/shortcut.test +++ b/modules/shortcut/shortcut.test @@ -313,6 +313,19 @@ class ShortcutSetsTestCase extends ShortcutTestCase { } /** + * Tests unassigning a shortcut set. + */ + function testShortcutSetUnassign() { + $new_set = $this->generateShortcutSet($this->randomName(10)); + + shortcut_set_assign_user($new_set, $this->shortcut_user); + shortcut_set_unassign_user($this->shortcut_user); + $current_set = shortcut_current_displayed_set($this->shortcut_user); + $default_set = shortcut_default_set($this->shortcut_user); + $this->assertTrue($current_set->set_name == $default_set->set_name, "Successfully unassigned another user's shortcut set."); + } + + /** * Tests deleting a shortcut set. */ function testShortcutSetDelete() { |