You are here

public function EntityDisplayTest::testEntityDisplayInvalidateCacheTags in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/field_ui/src/Tests/EntityDisplayTest.php \Drupal\field_ui\Tests\EntityDisplayTest::testEntityDisplayInvalidateCacheTags()

Ensure that entity view display changes invalidates cache tags.

File

core/modules/field_ui/src/Tests/EntityDisplayTest.php, line 418
Contains \Drupal\field_ui\Tests\EntityDisplayTest.

Class

EntityDisplayTest
Tests the entity display configuration entities.

Namespace

Drupal\field_ui\Tests

Code

public function testEntityDisplayInvalidateCacheTags() {
  $cache = \Drupal::cache();
  $cache
    ->set('cid', 'kittens', Cache::PERMANENT, [
    'config:entity_view_display_list',
  ]);
  $display = EntityViewDisplay::create([
    'targetEntityType' => 'entity_test',
    'bundle' => 'entity_test',
    'mode' => 'default',
  ]);
  $display
    ->setComponent('kitten');
  $display
    ->save();
  $this
    ->assertFalse($cache
    ->get('cid'));
}