You are here

public function CountLimitProcessorTest::testMinEqualsValue in Facets 8

Tests no filtering happens.

File

tests/src/Unit/Plugin/processor/CountLimitProcessorTest.php, line 96

Class

CountLimitProcessorTest
Unit test for processor.

Namespace

Drupal\Tests\facets\Unit\Plugin\processor

Code

public function testMinEqualsValue() {
  $facet = new Facet([], 'facets_facet');
  $facet
    ->setResults($this->originalResults);
  $facet
    ->addProcessor([
    'processor_id' => 'count_limit',
    'weights' => [],
    'settings' => [
      'minimum_items' => 5,
    ],
  ]);
  $this->processor
    ->setConfiguration([
    'minimum_items' => 5,
  ]);
  $sorted_results = $this->processor
    ->build($facet, $this->originalResults);
  $this
    ->assertCount(3, $sorted_results);
  $this
    ->assertEquals('llama', $sorted_results[0]
    ->getDisplayValue());
  $this
    ->assertEquals('badger', $sorted_results[1]
    ->getDisplayValue());
  $this
    ->assertEquals('duck', $sorted_results[2]
    ->getDisplayValue());
}