You are here

public function RangeSliderProcessorTest::testPreQuery in Facets 8

Tests the pre query method.

@covers ::preQuery

File

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

Class

RangeSliderProcessorTest
Unit test for processor.

Namespace

Drupal\Tests\facets_range_widget\Unit\Plugin\processor

Code

public function testPreQuery() {
  $facet = new Facet([
    'id' => 'llama',
  ], 'facets_facet');
  $facet
    ->setActiveItems([
    '(min:2,max:10)',
  ]);
  $this->processor
    ->preQuery($facet);
  $this
    ->assertCount(2, $facet
    ->getActiveItems()[0]);
  $this
    ->assertEquals([
    2,
    10,
  ], $facet
    ->getActiveItems()[0]);
}