You are here

protected function HideWhenNotRenderedProcessorTest::createContainer in Facets 8

Rendered in current request.

Parameters

bool $renderedInCurrentRequestValue: The value for rendered in current request.

2 calls to HideWhenNotRenderedProcessorTest::createContainer()
HideWhenNotRenderedProcessorTest::testBuild in modules/facets_summary/tests/src/Unit/Plugin/Processor/HideWhenNotRenderedProcessorTest.php
Tests the build method, containing the actual work of the processor.
HideWhenNotRenderedProcessorTest::testBuildWithNoCurrentRequest in modules/facets_summary/tests/src/Unit/Plugin/Processor/HideWhenNotRenderedProcessorTest.php
Tests the build method, containing the actual work of the processor.

File

modules/facets_summary/tests/src/Unit/Plugin/Processor/HideWhenNotRenderedProcessorTest.php, line 89

Class

HideWhenNotRenderedProcessorTest
Class HideWhenNotRenderedProcessorTest.

Namespace

Drupal\Tests\facets_summary\Unit\Plugin\Processor

Code

protected function createContainer($renderedInCurrentRequestValue) {
  $fsi = $this
    ->getMockBuilder(FacetSourcePluginInterface::class)
    ->disableOriginalConstructor()
    ->getMock();
  $fsi
    ->method('isRenderedInCurrentRequest')
    ->willReturn($renderedInCurrentRequestValue);
  $facetSourceManager = $this
    ->getMockBuilder(FacetSourcePluginManager::class)
    ->disableOriginalConstructor()
    ->getMock();
  $facetSourceManager
    ->method('createInstance')
    ->willReturn($fsi);
  $container = new ContainerBuilder();
  $container
    ->set('plugin.manager.facets.facet_source', $facetSourceManager);
  \Drupal::setContainer($container);
}