You are here

public function DefaultViewsTest::testPathDestination in Drupal 8

Same name and namespace in other branches
  1. 9 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 203

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
    ->assertLinkByHref('test_page_display_menu');
  $this
    ->assertNoLinkByHref('test_page_display_menu/default');
  $this
    ->assertLinkByHref('test_page_display_menu/local');

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