소스 검색

[Form] updated tests for changes in HttpFoundation

Kris Wallsmith 14 년 전
부모
커밋
0a229947a6
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      tests/Symfony/Tests/Component/Form/FormTest.php

+ 5 - 2
tests/Symfony/Tests/Component/Form/FormTest.php

@@ -333,6 +333,9 @@ class FormTest extends \PHPUnit_Framework_TestCase
 
     public function testBindReadsRequestData()
     {
+        $path = tempnam(sys_get_temp_dir(), 'sf2');
+        touch($path);
+
         $values = array(
             'author' => array(
                 'name' => 'Bernhard',
@@ -344,7 +347,7 @@ class FormTest extends \PHPUnit_Framework_TestCase
                 'error' => array('image' => array('file' => UPLOAD_ERR_OK)),
                 'name' => array('image' => array('file' => 'upload.png')),
                 'size' => array('image' => array('file' => 123)),
-                'tmp_name' => array('image' => array('file' => 'abcdef.png')),
+                'tmp_name' => array('image' => array('file' => $path)),
                 'type' => array('image' => array('file' => 'image/png')),
             ),
         );
@@ -358,7 +361,7 @@ class FormTest extends \PHPUnit_Framework_TestCase
 
         $form->bind($this->createPostRequest($values, $files));
 
-        $file = new UploadedFile('abcdef.png', 'upload.png', 'image/png', 123, UPLOAD_ERR_OK);
+        $file = new UploadedFile($path, 'upload.png', 'image/png', 123, UPLOAD_ERR_OK);
 
         $this->assertEquals('Bernhard', $form['name']->getData());
         $this->assertEquals('foobar.png', $form['image']['filename']->getData());