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.

30 lines
729 B
PHTML

<?php
11 years ago
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>');
}
}