public function BrowserTestBaseTest::testClickLink in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php \Drupal\FunctionalTests\BrowserTestBaseTest::testClickLink()
Tests clickLink() functionality.
File
- core/
tests/ Drupal/ FunctionalTests/ BrowserTestBaseTest.php, line 169
Class
- BrowserTestBaseTest
- Tests BrowserTestBase functionality.
Namespace
Drupal\FunctionalTestsCode
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());
}