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

Extract email validation into a method

This commit is contained in:
Francesc Rosàs 2013-05-25 17:01:14 +01:00
parent e3b9dd10c2
commit 9aa0aba77c
2 changed files with 16 additions and 2 deletions

View file

@ -13,10 +13,17 @@ class InitCommandTest extends TestCase
$command->parseAuthorString('John Smith <john@example.com>');
}
function testParseInvalidAuthorString()
function testParseEmptyAuthorString()
{
$command = new InitCommand;
$this->setExpectedException('InvalidArgumentException');
$command->parseAuthorString('');
}
function testParseAuthorStringWithInvalidEmail()
{
$command = new InitCommand;
$this->setExpectedException('InvalidArgumentException');
$command->parseAuthorString('John Smith <john>');
}
}