function IconsTwigExtensionTest::testGetIconRenderable
Test the IconsTwigExtension::getIconRenderable method.
File
-
core/
tests/ Drupal/ Tests/ Core/ Theme/ Icon/ IconsTwigExtensionTest.php, line 43
Class
- IconsTwigExtensionTest
- @coversDefaultClass \Drupal\Core\Template\IconsTwigExtension
Namespace
Drupal\Tests\Core\Theme\IconCode
public function testGetIconRenderable() : void {
$settings = [
'foo' => 'bar',
];
$result = $this->iconsTwigExtension
->getIconRenderable('pack_id', 'icon_id', $settings);
$expected = [
'#type' => 'icon',
'#pack_id' => 'pack_id',
'#icon_id' => 'icon_id',
'#settings' => $settings,
];
$this->assertEquals($expected, $result);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.