You are here

public function CoreViewsIntegrationTest::testExposedFilterUrlAlias in Core Views Facets 8

Tests that an url alias works correctly.

File

tests/src/Functional/CoreViewsIntegrationTest.php, line 51

Class

CoreViewsIntegrationTest
Tests the overall functionality of the Facets admin UI.

Namespace

Drupal\Tests\core_views_facets\Functional

Code

public function testExposedFilterUrlAlias() {
  $facet_name = "Test Facet URL";
  $facet_id = 'test_facet_url';

  // Make sure we're logged in with a user that has sufficient permissions.
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->createFacet($facet_name, $facet_id);
  $this
    ->drupalGet($this->facetUrl);
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertFacetLabel('item');
  $this
    ->assertFacetLabel('article');
  $this
    ->clickLink('item');
  $url = Url::fromUserInput('/' . $this->facetUrl . '/all/all', [
    'query' => [
      'type' => 'item',
    ],
  ]);
  $this
    ->assertSession()
    ->addressEquals($url);
}