瀏覽代碼

Test InitCommand::parseAuthorString()

Francesc Rosàs 12 年之前
父節點
當前提交
e3b9dd10c2
共有 1 個文件被更改,包括 22 次插入0 次删除
  1. 22 0
      tests/Composer/Test/Command/InitCommandTest.php

+ 22 - 0
tests/Composer/Test/Command/InitCommandTest.php

@@ -0,0 +1,22 @@
+<?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>');
+    }
+
+    function testParseInvalidAuthorString()
+    {
+        $command = new InitCommand;
+        $this->setExpectedException('InvalidArgumentException');
+        $command->parseAuthorString('');
+    }
+}