InitCommandTest.php 730 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Composer\Test\Autoload;
  3. use Composer\Command\InitCommand;
  4. use Composer\Test\TestCase;
  5. class InitCommandTest extends TestCase
  6. {
  7. function testParseValidAuthorString()
  8. {
  9. $command = new InitCommand;
  10. $command->parseAuthorString('John Smith <john@example.com>');
  11. }
  12. function testParseEmptyAuthorString()
  13. {
  14. $command = new InitCommand;
  15. $this->setExpectedException('InvalidArgumentException');
  16. $command->parseAuthorString('');
  17. }
  18. function testParseAuthorStringWithInvalidEmail()
  19. {
  20. $command = new InitCommand;
  21. $this->setExpectedException('InvalidArgumentException');
  22. $command->parseAuthorString('John Smith <john>');
  23. }
  24. }