function EngineTwigTest::testTwigUrlToString
Same name in other branches
- 9 core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php \Drupal\Tests\system\Functional\Theme\EngineTwigTest::testTwigUrlToString()
- 8.9.x core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php \Drupal\Tests\system\Functional\Theme\EngineTwigTest::testTwigUrlToString()
- 11.x core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php \Drupal\Tests\system\Functional\Theme\EngineTwigTest::testTwigUrlToString()
Tests the magic url to string Twig functions.
See also
File
-
core/
modules/ system/ tests/ src/ Functional/ Theme/ EngineTwigTest.php, line 120
Class
- EngineTwigTest
- Tests Twig-specific theme functionality.
Namespace
Drupal\Tests\system\Functional\ThemeCode
public function testTwigUrlToString() : void {
$this->drupalGet('twig-theme-test/url-to-string');
$expected = [
'rendered url: ' . Url::fromRoute('user.register')->toString(),
];
$content = $this->getSession()
->getPage()
->getContent();
$this->assertNotEmpty($content, 'Page content is not empty');
foreach ($expected as $string) {
$this->assertSession()
->responseContains('<div>' . $string . '</div>');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.