$form['cache']['contexts']['#description'].=' '.$this->t('This block is <em>always</em> varied by the following contexts: %required-context-list.',array('%required-context-list'=>$required_context_list));
}
// Add plugin-specific settings for this block type.
$form+=$this->blockForm($form,$form_state);
...
...
@@ -259,10 +228,6 @@ public function validateConfigurationForm(array &$form, FormStateInterface $form
// Remove the admin_label form item element value so it will not persist.
$form_state->unsetValue('admin_label');
// Transform the #type = checkboxes value to a numerically indexed array.
// Test that entities with caching disabled do not generate a cache entry.
$build=$this->getBlockRenderArray();
$this->assertTrue(isset($build['#cache'])&&array_keys($build['#cache'])==array('contexts','tags','max-age'),'The render array element of uncacheable blocks is not cached, but does have cache contexts, tags & max-age set.');
// Enable block caching.
$this->setBlockCacheConfig(array(
'max_age'=>600,
));
// Test that a cache entry is created.
$build=$this->getBlockRenderArray();
$cid='entity_view:block:test_block:en:core';
...
...
@@ -194,19 +185,10 @@ public function testBlockViewBuilderAlter() {
// Enable the block view alter hook that adds a suffix, for basic testing.