function ShortcutCacheTagsTest::createEntity
Same name in other branches
- 9 core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php \Drupal\Tests\shortcut\Functional\ShortcutCacheTagsTest::createEntity()
- 10 core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php \Drupal\Tests\shortcut\Functional\ShortcutCacheTagsTest::createEntity()
- 11.x core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php \Drupal\Tests\shortcut\Functional\ShortcutCacheTagsTest::createEntity()
Overrides EntityCacheTagsTestBase::createEntity
1 call to ShortcutCacheTagsTest::createEntity()
- ShortcutCacheTagsTest::testEntityCreation in core/
modules/ shortcut/ tests/ src/ Functional/ ShortcutCacheTagsTest.php - Tests that when creating a shortcut, the shortcut set tag is invalidated.
File
-
core/
modules/ shortcut/ tests/ src/ Functional/ ShortcutCacheTagsTest.php, line 48
Class
- ShortcutCacheTagsTest
- Tests the Shortcut entity's cache tags.
Namespace
Drupal\Tests\shortcut\FunctionalCode
protected function createEntity() {
// Create a "Llama" shortcut.
$shortcut = Shortcut::create([
'shortcut_set' => 'default',
'title' => t('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.