1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Fix Init Command to accept author names with Unicode combining diacritical marks

This commit is contained in:
Jose Miguel Pérez Ruiz 2017-03-16 01:43:54 +01:00 committed by Jordi Boggiano
parent a4c9c1235e
commit 4ba3c741f5
2 changed files with 11 additions and 1 deletions

View file

@ -33,6 +33,16 @@ class InitCommandTest extends TestCase
$this->assertEquals('matti@example.com', $author['email']);
}
public function testParseValidUtf8AuthorStringWithNonSpacingMarks()
{
// \xCC\x88 is UTF-8 for U+0308 diaeresis (umlaut) combining mark
$utf8_expected = "Matti Meika\xCC\x88la\xCC\x88inen";
$command = new InitCommand;
$author = $command->parseAuthorString($utf8_expected." <matti@example.com>");
$this->assertEquals($utf8_expected, $author['name']);
$this->assertEquals('matti@example.com', $author['email']);
}
public function testParseNumericAuthorString()
{
$command = new InitCommand;