function BrowserTestBaseTest::testDrupalGet
Same name in other branches
- 9 core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php \Drupal\FunctionalTests\BrowserTestBaseTest::testDrupalGet()
- 8.9.x core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php \Drupal\FunctionalTests\BrowserTestBaseTest::testDrupalGet()
- 11.x core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php \Drupal\FunctionalTests\BrowserTestBaseTest::testDrupalGet()
Tests drupalGet().
File
-
core/
tests/ Drupal/ FunctionalTests/ BrowserTestBaseTest.php, line 115
Class
- BrowserTestBaseTest
- Tests BrowserTestBase functionality.
Namespace
Drupal\FunctionalTestsCode
public function testDrupalGet() : void {
$this->drupalGet('test-page');
$this->assertSession()
->statusCodeEquals(200);
$this->assertSession()
->addressEquals('test-page');
$this->drupalGet('/test-page');
$this->assertSession()
->statusCodeEquals(200);
$this->assertSession()
->addressEquals('test-page');
$this->drupalGet('/test-page/');
$this->assertSession()
->statusCodeEquals(200);
$this->assertSession()
->addressEquals('/test-page/');
// Test alias handling.
$this->createPathAlias('/test-page', '/test-alias');
$this->rebuildAll();
$this->drupalGet('test-page');
$this->assertSession()
->statusCodeEquals(200);
$this->assertSession()
->addressEquals('test-alias');
$this->drupalGet('/test-page');
$this->assertSession()
->statusCodeEquals(200);
$this->assertSession()
->addressEquals('test-alias');
$this->drupalGet('/test-page/');
$this->assertSession()
->statusCodeEquals(200);
$this->assertSession()
->addressEquals('/test-page/');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.