public function ProcessorIntegrationTest::testSupportsFacet in Facets 8
Tests the facet support for a widget.
File
- tests/
src/ Functional/ ProcessorIntegrationTest.php, line 767
Class
- ProcessorIntegrationTest
- Tests the processor functionality.
Namespace
Drupal\Tests\facets\FunctionalCode
public function testSupportsFacet() {
$id = 'masked_owl';
$this
->createFacet('Australian masked owl', $id);
// Go to the facet edit page and check to see if the custom processor shows
// up.
$this
->drupalGet('admin/config/search/facets/' . $id . '/edit');
$this
->assertSession()
->pageTextContains('test pre query');
// Make the ::supportsFacet method on the custom processor return false.
\Drupal::state()
->set('facets_test_supports_facet', FALSE);
// Go to the facet edit page and check to see if the custom processor is
// now hidden.
$this
->drupalGet('admin/config/search/facets/' . $id . '/edit');
$this
->assertSession()
->pageTextNotContains('test pre query');
}