function SvgSpriteExtractorTest::testDiscoverIconsSvgSpriteInvalidContent
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Theme/Icon/Plugin/SvgSpriteExtractorTest.php \Drupal\Tests\Core\Theme\Icon\Plugin\SvgSpriteExtractorTest::testDiscoverIconsSvgSpriteInvalidContent()
Test the SvgSpriteExtractor::discoverIcons() method with invalid content.
File
-
core/
tests/ Drupal/ Tests/ Core/ Theme/ Icon/ Plugin/ SvgSpriteExtractorTest.php, line 203
Class
Namespace
Drupal\Tests\Core\Theme\Icon\PluginCode
public function testDiscoverIconsSvgSpriteInvalidContent() : void {
$icon = [
'icon_id' => 'foo',
'source' => '/path/source/foo.svg',
];
$this->iconFinder
->method('getFilesFromSources')
->willReturn($icon);
$this->iconFinder
->method('getFileContents')
->willReturn(FALSE);
$icons = $this->svgSpriteExtractorPlugin
->discoverIcons();
$this->assertEmpty($icons);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.