public function FileBagTest::testShouldConvertUploadedFilesWithPhpBug

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/FileBagTest.php, line 62

Class

FileBagTest
FileBagTest.

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testShouldConvertUploadedFilesWithPhpBug() {
  $tmpFile = $this
    ->createTempFile();
  $file = new UploadedFile($tmpFile, basename($tmpFile), 'text/plain', 100, 0);
  $bag = new FileBag(array(
    'child' => array(
      'name' => array(
        'file' => basename($tmpFile),
      ),
      'type' => array(
        'file' => 'text/plain',
      ),
      'tmp_name' => array(
        'file' => $tmpFile,
      ),
      'error' => array(
        'file' => 0,
      ),
      'size' => array(
        'file' => 100,
      ),
    ),
  ));
  $files = $bag
    ->all();
  $this
    ->assertEquals($file, $files['child']['file']);
}