function IconFinderTest::testExtractIconIdFromFilename

Test the IconFinder::extractIconIdFromFilename method.

Attributes

#[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 760

Class

IconFinderTest
Tests 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');
  $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.