You are here

public function UrlIntegrationTest::testFacetUrlCanBeChanged in Facets 8

Tests that modules can change the facet url.

File

tests/src/Functional/UrlIntegrationTest.php, line 222

Class

UrlIntegrationTest
Tests the overall functionality of the Facets admin UI.

Namespace

Drupal\Tests\facets\Functional

Code

public function testFacetUrlCanBeChanged() {
  $modules = [
    'facets_events_test',
  ];
  $success = $this->container
    ->get('module_installer')
    ->install($modules, TRUE);
  $this
    ->assertTrue($success, new FormattableMarkup('Enabled modules: %modules', [
    '%modules' => implode(', ', $modules),
  ]));
  $this
    ->rebuildAll();
  $id = 'facet';
  $name = 'Facet';
  $this
    ->createFacet($name, $id);
  $url = Url::fromUserInput('/search-api-test-fulltext', [
    'query' => [
      'f[0]' => 'facet:item',
      'test' => 'fun',
    ],
  ]);
  $this
    ->checkClickedFacetUrl($url);
}