Explorar el Código

Test InitCommand::parseAuthorString()

Francesc Rosàs hace 12 años
padre
commit
e3b9dd10c2
Se han modificado 1 ficheros con 22 adiciones y 0 borrados
  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('');
+    }
+}