You are here

private function HttpFoundationFactoryTest::createUploadedFile in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/psr-http-message-bridge/Tests/Factory/HttpFoundationFactoryTest.php \Symfony\Bridge\PsrHttpMessage\Tests\Factory\HttpFoundationFactoryTest::createUploadedFile()
3 calls to HttpFoundationFactoryTest::createUploadedFile()
HttpFoundationFactoryTest::testCreateRequest in vendor/symfony/psr-http-message-bridge/Tests/Factory/HttpFoundationFactoryTest.php
HttpFoundationFactoryTest::testCreateUploadedFile in vendor/symfony/psr-http-message-bridge/Tests/Factory/HttpFoundationFactoryTest.php
HttpFoundationFactoryTest::testCreateUploadedFileWithError in vendor/symfony/psr-http-message-bridge/Tests/Factory/HttpFoundationFactoryTest.php
@expectedException \Symfony\Component\HttpFoundation\File\Exception\FileException @expectedExceptionMessage The file "e" could not be written on disk.

File

vendor/symfony/psr-http-message-bridge/Tests/Factory/HttpFoundationFactoryTest.php, line 149

Class

HttpFoundationFactoryTest
@author Kévin Dunglas <dunglas@gmail.com>

Namespace

Symfony\Bridge\PsrHttpMessage\Tests\Factory

Code

private function createUploadedFile($content, $error, $clientFileName, $clientMediaType) {
  $filePath = tempnam($this->tmpDir, uniqid());
  file_put_contents($filePath, $content);
  return new UploadedFile($filePath, filesize($filePath), $error, $clientFileName, $clientMediaType);
}