ソースを参照

[HttpFoundation] added test for processed array in sub-requests

Fabien Pennequin 14 年 前
コミット
242562a361
1 ファイル変更10 行追加0 行削除
  1. 10 0
      tests/Symfony/Tests/Component/HttpFoundation/FileBagTest.php

+ 10 - 0
tests/Symfony/Tests/Component/HttpFoundation/FileBagTest.php

@@ -110,6 +110,16 @@ class FileBagTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals($file, $files['child']['sub']['file']);
     }
 
+    public function testShouldNotConvertNestedUploadedFiles()
+    {
+        $tmpFile = $this->createTempFile();
+        $file = new UploadedFile($tmpFile, basename($tmpFile), 'text/plain', 100, 0);
+        $bag = new FileBag(array('image' => array('file' => $file)));
+
+        $files = $bag->all();
+        $this->assertEquals($file, $files['image']['file']);
+    }
+
     protected function createTempFile()
     {
         return tempnam(sys_get_temp_dir(), 'FormTest');