浏览代码

[HttpFoundation] changed \LogicException to \InvalidArgumentException

Fabien Potencier 13 年之前
父节点
当前提交
8f50592f31

+ 1 - 1
src/Symfony/Component/HttpFoundation/FileBag.php

@@ -60,7 +60,7 @@ class FileBag extends ParameterBag
         if (is_array($value) || $value instanceof UploadedFile) {
             parent::set($key, $this->convertFileInformation($value));
         } else {
-            throw new \LogicException('An uploaded file must be an array or an instance of UploadedFile.');
+            throw new \InvalidArgumentException('An uploaded file must be an array or an instance of UploadedFile.');
         }
     }
 

+ 1 - 1
tests/Symfony/Tests/Component/HttpFoundation/FileBagTest.php

@@ -23,7 +23,7 @@ use Symfony\Component\HttpFoundation\FileBag;
 class FileBagTest extends \PHPUnit_Framework_TestCase
 {
     /**
-     * @expectedException \LogicException
+     * @expectedException \InvalidArgumentException
      */
     public function testFileMustBeAnArrayOrUploadedFile()
     {