2013-05-25 15:56:02 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Composer\Test\Autoload;
|
|
|
|
|
|
|
|
use Composer\Command\InitCommand;
|
|
|
|
use Composer\Test\TestCase;
|
|
|
|
|
|
|
|
class InitCommandTest extends TestCase
|
|
|
|
{
|
|
|
|
function testParseValidAuthorString()
|
|
|
|
{
|
|
|
|
$command = new InitCommand;
|
|
|
|
$command->parseAuthorString('John Smith <john@example.com>');
|
|
|
|
}
|
|
|
|
|
2013-05-25 16:01:14 +00:00
|
|
|
function testParseEmptyAuthorString()
|
2013-05-25 15:56:02 +00:00
|
|
|
{
|
|
|
|
$command = new InitCommand;
|
|
|
|
$this->setExpectedException('InvalidArgumentException');
|
|
|
|
$command->parseAuthorString('');
|
|
|
|
}
|
2013-05-25 16:01:14 +00:00
|
|
|
|
|
|
|
function testParseAuthorStringWithInvalidEmail()
|
|
|
|
{
|
|
|
|
$command = new InitCommand;
|
|
|
|
$this->setExpectedException('InvalidArgumentException');
|
|
|
|
$command->parseAuthorString('John Smith <john>');
|
|
|
|
}
|
2013-05-25 15:56:02 +00:00
|
|
|
}
|