You are here

public function UrlIntegrationTest::testCreatingDuplicateUrlAlias in Facets 8

Tests that creating a facet with a duplicate url alias emits a warning.

File

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

Class

UrlIntegrationTest
Tests the overall functionality of the Facets admin UI.

Namespace

Drupal\Tests\facets\Functional

Code

public function testCreatingDuplicateUrlAlias() {
  $this
    ->createFacet('Owl', 'owl');
  $this
    ->createFacet('Another owl', 'another_owl');
  $this
    ->drupalGet('admin/config/search/facets/another_owl/edit');
  $this
    ->drupalPostForm(NULL, [
    'facet_settings[url_alias]' => 'owl',
  ], 'Save');
  $this
    ->assertSession()
    ->pageTextContains('This alias is already in use for another facet defined on the same source.');
}