|
|
@ -17,6 +17,7 @@ use Composer\TestCase;
|
|
|
|
|
|
|
|
|
|
|
|
class InitCommandTest extends TestCase
|
|
|
|
class InitCommandTest extends TestCase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
public function testParseValidAuthorString()
|
|
|
|
public function testParseValidAuthorString()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$command = new InitCommand;
|
|
|
|
$command = new InitCommand;
|
|
|
@ -40,6 +41,32 @@ class InitCommandTest extends TestCase
|
|
|
|
$this->assertEquals('h4x0r', $author['name']);
|
|
|
|
$this->assertEquals('h4x0r', $author['name']);
|
|
|
|
$this->assertEquals('h4x@example.com', $author['email']);
|
|
|
|
$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()
|
|
|
|
public function testParseEmptyAuthorString()
|
|
|
|
{
|
|
|
|
{
|
|
|
|