You are here

public function ResetFacetsProcessorTest::testBuildWithEmptyItems in Facets 8

Tests the build method.

@covers ::build

File

modules/facets_summary/tests/src/Unit/Plugin/Processor/ResetFacetsProcessorTest.php, line 63

Class

ResetFacetsProcessorTest
Class ResetFacetsProcessorTest.

Namespace

Drupal\Tests\facets_summary\Unit\Plugin\Processor

Code

public function testBuildWithEmptyItems() {
  $summary = new FacetsSummary([], 'facets_summary');
  $summary
    ->setFacetSourceId('foo');
  $config = [
    'processor_id' => 'reset_facets',
    'weights' => [],
    'settings' => [
      'link_text' => 'Text',
    ],
  ];
  $summary
    ->addProcessor($config);
  $result = $this->processor
    ->build($summary, [
    'foo',
  ], []);
  $this
    ->assertSame('array', gettype($result));
}