protected function ShortcutCacheTagsTest::createEntity in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/shortcut/src/Tests/ShortcutCacheTagsTest.php \Drupal\shortcut\Tests\ShortcutCacheTagsTest::createEntity()
Creates the entity to be tested.
Return value
\Drupal\Core\Entity\EntityInterface The entity to be tested.
Overrides EntityCacheTagsTestBase::createEntity
1 call to ShortcutCacheTagsTest::createEntity()
- ShortcutCacheTagsTest::testEntityCreation in core/
modules/ shortcut/ src/ Tests/ ShortcutCacheTagsTest.php - Tests that when creating a shortcut, the shortcut set tag is invalidated.
File
- core/
modules/ shortcut/ src/ Tests/ ShortcutCacheTagsTest.php, line 44 - Contains \Drupal\shortcut\Tests\ShortcutCacheTagsTest.
Class
- ShortcutCacheTagsTest
- Tests the Shortcut entity's cache tags.
Namespace
Drupal\shortcut\TestsCode
protected function createEntity() {
// Create a "Llama" shortcut.
$shortcut = Shortcut::create(array(
'shortcut_set' => 'default',
'title' => t('Llama'),
'weight' => 0,
'link' => [
[
'uri' => 'internal:/admin',
],
],
));
$shortcut
->save();
return $shortcut;
}