You are here

public function DependentFacetProcessorTest::testNoEnabledFacets in Facets 8

Tests the case where no facets are enabled.

File

tests/src/Unit/Plugin/processor/DependentFacetProcessorTest.php, line 60

Class

DependentFacetProcessorTest
Unit test for processor.

Namespace

Drupal\Tests\facets\Unit\Plugin\processor

Code

public function testNoEnabledFacets() {
  $facetManager = $this
    ->prophesize(DefaultFacetManager::class)
    ->reveal();
  $etm = $this
    ->prophesize(EntityTypeManagerInterface::class)
    ->reveal();
  $configuration = [
    'owl' => [
      'enable' => FALSE,
      'condition' => 'not_empty',
    ],
  ];
  $dfp = new DependentFacetProcessor($configuration, 'dependent_facet_processor', [], $facetManager, $etm);
  $facet = new Facet([
    'id' => 'owl',
    'name' => 'øwl',
  ], 'facets_facet');
  $computed = $dfp
    ->build($facet, $this->results);
  $this
    ->assertEquals($computed, $this->results);
}