function AssertLegacyTrait::assertTitle
Same name in other branches
- 8.9.x core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php \Drupal\FunctionalTests\AssertLegacyTrait::assertTitle()
Pass if the page title is the given string.
Parameters
string $expected_title: The string the page title should be.
Deprecated
in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->titleEquals() instead.
See also
https://www.drupal.org/node/3129738
1 call to AssertLegacyTrait::assertTitle()
- BrowserTestBaseTest::testAssertTitle in core/
tests/ Drupal/ FunctionalTests/ BrowserTestBaseTest.php - Tests legacy assertTitle().
File
-
core/
tests/ Drupal/ FunctionalTests/ AssertLegacyTrait.php, line 423
Class
- AssertLegacyTrait
- Provides convenience methods for assertions in browser tests.
Namespace
Drupal\FunctionalTestsCode
protected function assertTitle($expected_title) {
@trigger_error('AssertLegacyTrait::assertTitle() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->titleEquals() instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);
// Cast MarkupInterface to string.
$expected_title = (string) $expected_title;
return $this->assertSession()
->titleEquals($expected_title);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.