You are here

protected function IntegrationTest::setOptionShowOnlyWhenFacetSourceVisible in Facets 8

Configures a facet to only be visible when accessing to the facet source.

Parameters

string $facet_name: The name of the facet.

1 call to IntegrationTest::setOptionShowOnlyWhenFacetSourceVisible()
IntegrationTest::testFramework in tests/src/Functional/IntegrationTest.php
Tests various operations via the Facets' admin UI.

File

tests/src/Functional/IntegrationTest.php, line 905

Class

IntegrationTest
Tests the overall functionality of the Facets admin UI.

Namespace

Drupal\Tests\facets\Functional

Code

protected function setOptionShowOnlyWhenFacetSourceVisible($facet_name) {
  $facet_id = $this
    ->convertNameToMachineName($facet_name);
  $facet_edit_page = '/admin/config/search/facets/' . $facet_id . '/edit';
  $this
    ->drupalGet($facet_edit_page);
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $edit = [
    'facet_settings[only_visible_when_facet_source_is_visible]' => TRUE,
    'widget' => 'links',
    'widget_config[show_numbers]' => '0',
  ];
  $this
    ->drupalPostForm(NULL, $edit, 'Save');
}