function IconFinderTest::testGetFilesFromPathEmptyWarning

Test the IconFinder::getFilesFromPath method with warning.

File

core/tests/Drupal/Tests/Core/Theme/Icon/IconFinderTest.php, line 645

Class

IconFinderTest
@coversDefaultClass \Drupal\Core\Theme\Icon\IconFinder[[api-linebreak]]

Namespace

Drupal\Tests\Core\Theme\Icon

Code

public function testGetFilesFromPathEmptyWarning() : void {
  $method = new \ReflectionMethod(IconFinder::class, 'getFilesFromPath');
  $method->setAccessible(TRUE);
  $this->logger
    ->expects($this->once())
    ->method('warning')
    ->with('Invalid icon path extension @filename.@extension in source: @source');
  $method->invoke($this->iconFinder, self::TEST_ICONS_PATH . '/icons/flat/foo.webp', '');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.