diff --git a/core/modules/shortcut/src/Tests/ShortcutLinksTest.php b/core/modules/shortcut/src/Tests/ShortcutLinksTest.php index 67f40ad..1c6cc61 100644 --- a/core/modules/shortcut/src/Tests/ShortcutLinksTest.php +++ b/core/modules/shortcut/src/Tests/ShortcutLinksTest.php @@ -6,6 +6,7 @@ */ namespace Drupal\shortcut\Tests; +use Drupal\shortcut\Entity\ShortcutSet; /** * Defines shortcut links test cases. @@ -60,7 +61,7 @@ public function testShortcutLinkAdd() { ); $this->drupalPostForm('admin/config/user-interface/shortcut/manage/' . $set->id() . '/add-link', $form_data, t('Save')); $this->assertResponse(200); - $saved_set = shortcut_set_load($set->id()); + $saved_set = ShortcutSet::load($set->id()); $paths = $this->getShortcutInformation($saved_set, 'path'); $this->assertTrue(in_array($this->container->get('path.alias_manager')->getSystemPath($test['path']), $paths), 'Shortcut created: ' . $test['path']); $this->assertLink($title, 0, 'Shortcut link found on the page.'); @@ -110,7 +111,7 @@ public function testShortcutLinkRename() { $shortcuts = $set->getShortcuts(); $shortcut = reset($shortcuts); $this->drupalPostForm('admin/config/user-interface/shortcut/link/' . $shortcut->id(), array('title[0][value]' => $new_link_name, 'path' => $shortcut->path->value), t('Save')); - $saved_set = shortcut_set_load($set->id()); + $saved_set = ShortcutSet::load($set->id()); $titles = $this->getShortcutInformation($saved_set, 'title'); $this->assertTrue(in_array($new_link_name, $titles), 'Shortcut renamed: ' . $new_link_name); $this->assertLink($new_link_name, 0, 'Renamed shortcut link appears on the page.'); @@ -128,7 +129,7 @@ public function testShortcutLinkChangePath() { $shortcuts = $set->getShortcuts(); $shortcut = reset($shortcuts); $this->drupalPostForm('admin/config/user-interface/shortcut/link/' . $shortcut->id(), array('title[0][value]' => $shortcut->getTitle(), 'path' => $new_link_path), t('Save')); - $saved_set = shortcut_set_load($set->id()); + $saved_set = ShortcutSet::load($set->id()); $paths = $this->getShortcutInformation($saved_set, 'path'); $this->assertTrue(in_array($new_link_path, $paths), 'Shortcut path changed: ' . $new_link_path); $this->assertLinkByHref($new_link_path, 0, 'Shortcut with new path appears on the page.'); @@ -156,7 +157,7 @@ public function testShortcutLinkDelete() { $shortcuts = $set->getShortcuts(); $shortcut = reset($shortcuts); $this->drupalPostForm('admin/config/user-interface/shortcut/link/' . $shortcut->id() . '/delete', array(), 'Delete'); - $saved_set = shortcut_set_load($set->id()); + $saved_set = ShortcutSet::load($set->id()); $ids = $this->getShortcutInformation($saved_set, 'id'); $this->assertFalse(in_array($shortcut->id(), $ids), 'Successfully deleted a shortcut.'); diff --git a/core/modules/shortcut/src/Tests/ShortcutSetsTest.php b/core/modules/shortcut/src/Tests/ShortcutSetsTest.php index 2a31535..c17316d 100644 --- a/core/modules/shortcut/src/Tests/ShortcutSetsTest.php +++ b/core/modules/shortcut/src/Tests/ShortcutSetsTest.php @@ -6,6 +6,7 @@ */ namespace Drupal\shortcut\Tests; +use Drupal\shortcut\Entity\ShortcutSet; /** * Defines shortcut set test cases. @@ -98,7 +99,7 @@ function testShortcutSetRename() { $this->drupalGet('admin/config/user-interface/shortcut'); $this->clickLink(t('Edit shortcut set')); $this->drupalPostForm(NULL, array('label' => $new_label), t('Save')); - $set = shortcut_set_load($set->id()); + $set = ShortcutSet::load($set->id()); $this->assertTrue($set->label() == $new_label, 'Shortcut set has been successfully renamed.'); } @@ -110,7 +111,7 @@ function testShortcutSetRenameAlreadyExists() { $existing_label = $this->set->label(); $this->drupalPostForm('admin/config/user-interface/shortcut/manage/' . $set->id(), array('label' => $existing_label), t('Save')); $this->assertRaw(t('The shortcut set %name already exists. Choose another name.', array('%name' => $existing_label))); - $set = shortcut_set_load($set->id()); + $set = ShortcutSet::load($set->id()); $this->assertNotEqual($set->label(), $existing_label, format_string('The shortcut set %title cannot be renamed to %new-title because a shortcut set with that title already exists.', array('%title' => $set->label(), '%new-title' => $existing_label))); } diff --git a/core/modules/shortcut/src/Tests/ShortcutTestBase.php b/core/modules/shortcut/src/Tests/ShortcutTestBase.php index de9e110..461a40c 100644 --- a/core/modules/shortcut/src/Tests/ShortcutTestBase.php +++ b/core/modules/shortcut/src/Tests/ShortcutTestBase.php @@ -7,6 +7,7 @@ namespace Drupal\shortcut\Tests; +use Drupal\shortcut\Entity\ShortcutSet; use Drupal\shortcut\ShortcutSetInterface; use Drupal\simpletest\WebTestBase; @@ -79,7 +80,7 @@ function setUp() { // Log in as admin and grab the default shortcut set. $this->drupalLogin($this->admin_user); - $this->set = shortcut_set_load('default'); + $this->set = ShortcutSet::load('default'); shortcut_set_assign_user($this->set, $this->admin_user); }