diff --git a/src/Tests/EntityEmbedFilterTest.php b/src/Tests/EntityEmbedFilterTest.php index cbaebff..e3dd8c8 100644 --- a/src/Tests/EntityEmbedFilterTest.php +++ b/src/Tests/EntityEmbedFilterTest.php @@ -80,6 +80,7 @@ class EntityEmbedFilterTest extends EntityEmbedTestBase { $this->assertText($this->node->body->value, 'Embedded node exists in page.'); $this->assertNoText(strip_tags($content), 'Placeholder does not appear in the output when embed is successful.'); $this->assertRaw('
', 'Embed container found.'); + $this->assertCacheTag('foo:' . $this->node->id()); // Ensure that placeholder is not replaced when embed is unsuccessful. $content = 'This placeholder should be rendered since specified entity does not exists.'; diff --git a/src/Tests/EntityReferenceFieldFormatterTest.php b/src/Tests/EntityReferenceFieldFormatterTest.php index f7a6834..9676ebd 100644 --- a/src/Tests/EntityReferenceFieldFormatterTest.php +++ b/src/Tests/EntityReferenceFieldFormatterTest.php @@ -54,7 +54,6 @@ class EntityReferenceFieldFormatterTest extends EntityEmbedTestBase { $display->setContextValue('entity', $this->node); $conf_form = $display->buildConfigurationForm($form, $form_state); $this->assertIdentical(array_keys($conf_form), array()); - $this->assertCacheTag('foo:bar'); // Ensure that correct form attributes are returned for // 'entity_reference:entity_reference_entity_view' plugin. diff --git a/tests/modules/entity_embed_test/entity_embed_test.module b/tests/modules/entity_embed_test/entity_embed_test.module index f41c0b5..eb2c37f 100644 --- a/tests/modules/entity_embed_test/entity_embed_test.module +++ b/tests/modules/entity_embed_test/entity_embed_test.module @@ -79,5 +79,5 @@ function entity_embed_test_entity_embed_alter(array &$build, EntityInterface $en * Implements hook_entity_access(). */ function entity_embed_test_entity_access(EntityInterface $entity, $operation, AccountInterface $account) { - return AccessResult::allowed()->addCacheTags(['foo:bar']); + return AccessResult::allowed()->addCacheTags(['foo:' . $entity->id()]); }