$this->
assertSame($expected_cache_tags,
$cache_entry->tags
);
$cache_entry = \Drupal::
cache('render'
)->
get('entity_view:block:powered:' .
implode(':',
$keys));
$expected_cache_tags =
[ 'block_view',
'config:block.block.powered',
'rendered',
];
sort($expected_cache_tags);
$this->
assertSame($expected_cache_tags,
$cache_entry->tags
);
// The "Powered by Drupal" block is modified; verify a cache miss.
$block->
setRegion('content'
);
$block->
save();
$this->
drupalGet('<front>'
);
$this->
assertSession()->
responseHeaderEquals('X-Drupal-Cache', 'MISS'
);
// Now we should have a cache hit again.
$this->
drupalGet('<front>'
);
$this->
assertSession()->
responseHeaderEquals('X-Drupal-Cache', 'HIT'
);
// Place the "Powered by Drupal" block another time; verify a cache miss.
$this->
drupalPlaceBlock('system_powered_by_block',
['id' => 'powered-2'
]);
$this->
drupalGet('<front>'
);