function IconFinderTest::testExtractIconIdFromFilename

Test the IconFinder::extractIconIdFromFilename method.

@dataProvider providerExtractIconIdFromFilename

Parameters

string $filename: The filename found to match against.

string $filename_pattern: The path with {icon_id}.

string $expected: The expected result.

File

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

Class

IconFinderTest
@coversDefaultClass \Drupal\Core\Theme\Icon\IconFinder

Namespace

Drupal\Tests\Core\Theme\Icon

Code

public function testExtractIconIdFromFilename(string $filename, string $filename_pattern, string $expected) : void {
    $method = new \ReflectionMethod(IconFinder::class, 'extractIconIdFromFilename');
    $method->setAccessible(TRUE);
    $this->assertEquals($expected, $method->invoke($this->iconFinder, $filename, $filename_pattern));
}

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