public function NameFormatParserTest::testParser in Name Field 8
Test NameFormatParser.
@dataProvider patternDataProvider
File
- tests/
src/ Unit/ NameFormatParserTest.php, line 71
Class
- NameFormatParserTest
- Tests the name formatter.
Namespace
Drupal\Tests\name\UnitCode
public function testParser($components, $pattern, $expected) {
$settings = [
'sep1' => ' ',
'sep2' => ', ',
'sep3' => '',
];
$formatted = $this->parser
->parse($components, $pattern, $settings);
$this
->assertEquals($expected, $formatted);
}