You are here

public function FileBagTest::testShouldConvertsUploadedFiles in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Tests/FileBagTest.php \Symfony\Component\HttpFoundation\Tests\FileBagTest::testShouldConvertsUploadedFiles()

File

vendor/symfony/http-foundation/Tests/FileBagTest.php, line 33

Class

FileBagTest
FileBagTest.

Namespace

Symfony\Component\HttpFoundation\Tests

Code

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