public function TwigExtensionTest::testLinkWithOverriddenAttributes in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php \Drupal\Tests\Core\Template\TwigExtensionTest::testLinkWithOverriddenAttributes()
- 10 core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php \Drupal\Tests\Core\Template\TwigExtensionTest::testLinkWithOverriddenAttributes()
@covers ::getLink
File
- core/
tests/ Drupal/ Tests/ Core/ Template/ TwigExtensionTest.php, line 363
Class
- TwigExtensionTest
- Tests the twig extension.
Namespace
Drupal\Tests\Core\TemplateCode
public function testLinkWithOverriddenAttributes() {
$url = Url::fromRoute('<front>', [], [
'attributes' => [
'class' => [
'foo',
],
],
]);
$build = $this->systemUnderTest
->getLink('test', $url, [
'class' => [
'bar',
],
]);
$this
->assertEquals([
'foo',
'bar',
], $build['#url']
->getOption('attributes')['class']);
}