function KernelTestHttpRequestTest::testClickLink
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/KernelTestHttpRequestTest.php \Drupal\KernelTests\KernelTestHttpRequestTest::testClickLink()
Tests clickLink() functionality.
File
-
core/
tests/ Drupal/ KernelTests/ KernelTestHttpRequestTest.php, line 52
Class
- KernelTestHttpRequestTest
- Tests making HTTP requests in a kernel test.
Namespace
Drupal\KernelTestsCode
public function testClickLink() : void {
$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());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.