function DefaultViewsTest::testPathDestination

Same name and namespace in other branches
  1. 8.9.x 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()
  3. 11.x 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 192

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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.