You are here

public function RangeSliderProcessorTest::setUp in Facets 8

Overrides UnitTestCase::setUp

File

modules/facets_range_widget/tests/src/Unit/Plugin/processor/RangeSliderProcessorTest.php, line 36

Class

RangeSliderProcessorTest
Unit test for processor.

Namespace

Drupal\Tests\facets_range_widget\Unit\Plugin\processor

Code

public function setUp() {
  parent::setUp();
  $this->processor = new RangeSliderProcessor([], 'range_slider', []);
  $facets_url_generator = $this
    ->prophesize(FacetsUrlGenerator::class);
  $facets_url_generator
    ->getUrl(Argument::any(), Argument::any())
    ->willReturn(new Url('test', [], [
    'query' => [
      'f' => [
        'animals::(min:__range_slider_min__,max:__range_slider_max__)',
      ],
    ],
  ]));
  $url_generator = $this
    ->prophesize(UrlGeneratorInterface::class);
  $container = new ContainerBuilder();
  $container
    ->set('url_generator', $url_generator
    ->reveal());
  $container
    ->set('facets.utility.url_generator', $facets_url_generator
    ->reveal());
  \Drupal::setContainer($container);
}