Просмотр исходного кода

Test InitCommand::parseAuthorString()

Francesc Rosàs 12 лет назад
Родитель
Сommit
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('');
+    }
+}