Commit 3574e670 authored by catch's avatar catch

Issue #1987236 by dawehner, kalabro: [regression] Views block cache setting doesn't work.

parent 4c644028
......@@ -174,6 +174,19 @@ protected function testDeleteBlockDisplay() {
$this->assertBlockAppears($block_4);
}
/**
* Tests views block plugin definitions.
*/
public function testViewsBlockPlugins() {
// Ensures that the cache setting gets to the block settings.
$instance = $this->container->get('plugin.manager.block')->createInstance('views_block:test_view_block2-block_2');
$configuration = $instance->getConfiguration();
$this->assertEqual($configuration['cache'], DRUPAL_NO_CACHE);
$instance = $this->container->get('plugin.manager.block')->createInstance('views_block:test_view_block2-block_3');
$configuration = $instance->getConfiguration();
$this->assertEqual($configuration['cache'], DRUPAL_CACHE_PER_USER);
}
/**
* Test the block form for a Views block.
*/
......
......@@ -51,6 +51,16 @@ display:
field:
title:
link_to_node: '1'
block_3:
display_plugin: block
id: block_3
display_title: Block
position: ''
display_options:
block_caching: '2'
field:
title:
link_to_node: '1'
label: test_view_block2
module: views
id: test_view_block2
......
......@@ -56,6 +56,11 @@ public function defaultConfiguration() {
$settings += $this->view->display_handler->blockSettings($settings);
}
// Set custom cache settings.
if (isset($this->pluginDefinition['cache'])) {
$settings['cache'] = $this->pluginDefinition['cache'];
}
return $settings;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment