You are here

public function DefaultViewsTest::testPathDestination in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php \Drupal\Tests\views_ui\Functional\DefaultViewsTest::testPathDestination()
  2. 10 core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php \Drupal\Tests\views_ui\Functional\DefaultViewsTest::testPathDestination()

Tests that page displays show the correct path.

File

core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php, line 208

Class

DefaultViewsTest
Tests enabling, disabling, and reverting default views via the listing page.

Namespace

Drupal\Tests\views_ui\Functional

Code

public function testPathDestination() {
  $this
    ->drupalGet('admin/structure/views');

  // Check that links to views on default tabs are rendered correctly.
  $this
    ->assertSession()
    ->linkByHrefExists('test_page_display_menu');
  $this
    ->assertSession()
    ->linkByHrefNotExists('test_page_display_menu/default');
  $this
    ->assertSession()
    ->linkByHrefExists('test_page_display_menu/local');

  // Check that a dynamic path is shown as text.
  $this
    ->assertSession()
    ->responseContains('test_route_with_suffix/%/suffix');
  $this
    ->assertSession()
    ->linkByHrefNotExists(Url::fromUri('base:test_route_with_suffix/%/suffix')
    ->toString());
}