public function TocFormatterTest::testConvertStringToId in TOC API 8
Tests converting string to valid HTML id with TocFormatter::convertStringToId().
@dataProvider providerConvertStringToId
Parameters
string $string: The string to run through $this->formatter->convertStringToId().
string $expected: The expected result from calling the function.
See also
TocFormatter::convertStringToId()
File
- tests/
src/ Unit/ TocFormatterTest.php, line 50 - Contains \Drupal\Tests\toc_api\Unit\TocFormatterTest.
Class
- TocFormatterTest
- Tests TOC API formatter.
Namespace
Drupal\Tests\toc_api\UnitCode
public function testConvertStringToId($string, $expected) {
$result = $this->formatter
->convertStringToId($string);
$this
->assertEquals($expected, $result);
}