Commit 43af879b authored by borisson_'s avatar borisson_ Committed by borisson_

Issue #2978535 by borisson_, andreasderijcke, Nick_vh: Facet Summary: "Hide...

Issue #2978535 by borisson_, andreasderijcke, Nick_vh: Facet Summary: "Hide Summary when Facet Source is not rendered" doesn't work
parent 36bb4a24
......@@ -15,7 +15,7 @@ use Drupal\facets_summary\Processor\ProcessorPluginBase;
* description = @Translation("When checked, this facet will only be rendered when the facet source is rendered. If you want to show facets on other pages too, you need to uncheck this setting."),
* default_enabled = TRUE,
* stages = {
* "build" = 10
* "build" = 45
* }
* )
*/
......
......@@ -17,7 +17,7 @@ use Drupal\facets_summary\Processor\ProcessorPluginBase;
* label = @Translation("Adds reset facets link."),
* description = @Translation("When checked, this facet will add a link to reset enabled facets."),
* stages = {
* "build" = 50
* "build" = 30
* }
* )
*/
......
......@@ -14,7 +14,7 @@ use Drupal\facets_summary\Processor\ProcessorPluginBase;
* label = @Translation("Show a summary of how many results were found"),
* description = @Translation("When checked, this will show the amount of results found."),
* stages = {
* "build" = 50
* "build" = 5
* }
* )
*/
......
......@@ -14,7 +14,7 @@ use Drupal\facets_summary\Processor\ProcessorPluginBase;
* label = @Translation("Show a summary of all selected facets"),
* description = @Translation("When checked, this facet will show an imploded list of all selected facets."),
* stages = {
* "build" = 50
* "build" = 20
* }
* )
*/
......
......@@ -16,7 +16,7 @@ use Drupal\facets_summary\Processor\ProcessorPluginBase;
* description = @Translation("Show a text when there are no results, otherwise it will hide the block."),
* default_enabled = TRUE,
* stages = {
* "build" = 30
* "build" = 10
* }
* )
*/
......
<?php
namespace Drupal\Tests\facets_summary\Kernel;
use Drupal\KernelTests\KernelTestBase;
/**
* Class ProcessorTest.
*
* @group facets
*/
class ProcessorTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
'facets',
'facets_summary',
];
/**
* {@inheritdoc}
*/
public function setUp() {
parent::setUp();
$this->installEntitySchema('facets_facet');
$this->installEntitySchema('facets_summary');
}
/**
* Tests that the "hide when not rendered" processors is last.
*/
public function testHideWhenNotRenderedIsLast() {
/** @var \Drupal\facets_summary\Processor\ProcessorPluginManager $processor_manager */
$processor_manager = $this->container->get('plugin.manager.facets_summary.processor');
$defs = $processor_manager->getDefinitions();
$hide_when_not_rendered_weight = $defs['hide_when_not_rendered']['stages']['build'];
unset($defs['hide_when_not_rendered']);
foreach ($defs as $def) {
$this->assertLessThan($hide_when_not_rendered_weight, $def['stages']['build']);
}
}
}
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