function IconPackManagerKernelTest::testGetIcon
Test the IconPackManager::getIcon method.
File
- 
              core/
tests/ Drupal/ KernelTests/ Core/ Theme/ Icon/ IconPackManagerKernelTest.php, line 111  
Class
- IconPackManagerKernelTest
 - Tests values are from test module icon_test.
 
Namespace
Drupal\KernelTests\Core\Theme\IconCode
public function testGetIcon() : void {
  $icon = $this->pluginManagerIconPack
    ->getIcon(self::TEST_ICON_FULL_ID);
  $this->assertInstanceOf(IconDefinitionInterface::class, $icon);
  $icon = $this->pluginManagerIconPack
    ->getIcon('test_minimal:_do_not_exist_');
  $this->assertNull($icon);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.