function ShortcutCacheTagsTest::createShortcutEntity
Same name and namespace in other branches
- 11.x core/modules/shortcut/tests/src/Kernel/ShortcutCacheTagsTest.php \Drupal\Tests\shortcut\Kernel\ShortcutCacheTagsTest::createShortcutEntity()
Creates a shortcut entity in the default shortcut set.
1 call to ShortcutCacheTagsTest::createShortcutEntity()
- ShortcutCacheTagsTest::testEntityCreation in core/
modules/ shortcut/ tests/ src/ Kernel/ ShortcutCacheTagsTest.php - Tests that when creating a shortcut, the shortcut set tag is invalidated.
File
-
core/
modules/ shortcut/ tests/ src/ Kernel/ ShortcutCacheTagsTest.php, line 63
Class
- ShortcutCacheTagsTest
- Tests the Shortcut entity's cache tags.
Namespace
Drupal\Tests\shortcut\KernelCode
protected function createShortcutEntity() : Shortcut {
// Create a "Llama" shortcut.
$shortcut = Shortcut::create([
'shortcut_set' => $this->shortcutSet
->id(),
'title' => 'Llama',
'weight' => 0,
'link' => [
[
'uri' => 'internal:/admin',
],
],
]);
$shortcut->save();
return $shortcut;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.