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

Fix for issue #5631

- Add " ( and ) as valid characters in author name
- Add relavent unit tests
This commit is contained in:
Matthew "Juniper" Barlett 2016-08-31 01:29:22 -05:00 committed by Jordi Boggiano
parent ed78253c58
commit ac41bb0615
2 changed files with 28 additions and 1 deletions

View file

@ -17,6 +17,7 @@ use Composer\TestCase;
class InitCommandTest extends TestCase
{
public function testParseValidAuthorString()
{
$command = new InitCommand;
@ -40,6 +41,32 @@ class InitCommandTest extends TestCase
$this->assertEquals('h4x0r', $author['name']);
$this->assertEquals('h4x@example.com', $author['email']);
}
/**
* Test scenario for issue #5631
* @link https://github.com/composer/composer/issues/5631 Issue #5631
*/
public function testParseValidAlias1AuthorString()
{
$command = new InitCommand;
$author = $command->parseAuthorString(
'Johnathon "Johnny" Smith <john@example.com>');
$this->assertEquals('Johnathon "Johnny" Smith', $author['name'] );
$this->assertEquals('john@example.com', $author['email']);
}
/**
* Test scenario for issue #5631
* @link https://github.com/composer/composer/issues/5631 Issue #5631
*/
public function testParseValidAlias2AuthorString()
{
$command = new InitCommand;
$author = $command->parseAuthorString(
'Johnathon (Johnny) Smith <john@example.com>');
$this->assertEquals('Johnathon (Johnny) Smith', $author['name'] );
$this->assertEquals('john@example.com', $author['email']);
}
public function testParseEmptyAuthorString()
{