You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Composer\Test\Command;
|
|
|
|
|
|
|
|
use Composer\Command\InitCommand;
|
|
|
|
use Composer\Test\TestCase;
|
|
|
|
|
|
|
|
class InitCommandTest extends TestCase
|
|
|
|
{
|
|
|
|
function testParseValidAuthorString()
|
|
|
|
{
|
|
|
|
$command = new InitCommand;
|
|
|
|
$command->parseAuthorString('John Smith <john@example.com>');
|
|
|
|
}
|
|
|
|
|
|
|
|
function testParseEmptyAuthorString()
|
|
|
|
{
|
|
|
|
$command = new InitCommand;
|
|
|
|
$this->setExpectedException('InvalidArgumentException');
|
|
|
|
$command->parseAuthorString('');
|
|
|
|
}
|
|
|
|
|
|
|
|
function testParseAuthorStringWithInvalidEmail()
|
|
|
|
{
|
|
|
|
$command = new InitCommand;
|
|
|
|
$this->setExpectedException('InvalidArgumentException');
|
|
|
|
$command->parseAuthorString('John Smith <john>');
|
|
|
|
}
|
|
|
|
}
|