You are here

public function CoreViewsIntegrationTest::testContextualFilterUrlAlias in Core Views Facets 8

Tests that an url alias works correctly.

File

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

Class

CoreViewsIntegrationTest
Tests the overall functionality of the Facets admin UI.

Namespace

Drupal\Tests\core_views_facets\Functional

Code

public function testContextualFilterUrlAlias() {
  $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, 'type', 'page_1', 'core_views_facets_basic_integration', 'contextual');
  $this
    ->drupalGet($this->facetUrl);
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertFacetLabel('item');
  $this
    ->assertFacetLabel('article');
  $this
    ->clickLink('item');
  $url = Url::fromUserInput('/' . $this->facetUrl . '/all/item');
  $this
    ->assertSession()
    ->addressEquals($url);
}