You are here

public function BrowserTestBaseTest::testClickLink in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php \Drupal\FunctionalTests\BrowserTestBaseTest::testClickLink()

Tests clickLink() functionality.

File

core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php, line 178

Class

BrowserTestBaseTest
Tests BrowserTestBase functionality.

Namespace

Drupal\FunctionalTests

Code

public function testClickLink() {
  $this
    ->drupalGet('test-page');
  $this
    ->clickLink('Visually identical test links');
  $this
    ->assertStringContainsString('user/login', $this
    ->getSession()
    ->getCurrentUrl());
  $this
    ->drupalGet('test-page');
  $this
    ->clickLink('Visually identical test links', 0);
  $this
    ->assertStringContainsString('user/login', $this
    ->getSession()
    ->getCurrentUrl());
  $this
    ->drupalGet('test-page');
  $this
    ->clickLink('Visually identical test links', 1);
  $this
    ->assertStringContainsString('user/register', $this
    ->getSession()
    ->getCurrentUrl());
}