You are here

public function HideOnlyOneItemProcessorTest::testWithOneResult in Facets 8

Tests with one result.

@covers ::build

File

tests/src/Unit/Plugin/processor/HideOnlyOneItemProcessorTest.php, line 23

Class

HideOnlyOneItemProcessorTest
Class HideOnlyOneItemProcessorTest.

Namespace

Drupal\Tests\facets\Unit\Plugin\processor

Code

public function testWithOneResult() {
  $processor = new HideOnlyOneItemProcessor([], 'hide_only_one_item', []);
  $facet = new Facet([], 'facets_facet');
  $results = [
    new Result($facet, '1', 1, 1),
  ];
  $facet = $this
    ->getMockBuilder(Facet::class)
    ->disableOriginalConstructor()
    ->getMock();
  $processed_results = $processor
    ->build($facet, $results);
  $this
    ->assertCount(0, $processed_results);
}