4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Bridge\PsrHttpMessage\Tests\Fixtures;
14 use Psr\Http\Message\UploadedFileInterface;
17 * @author Kévin Dunglas <dunglas@gmail.com>
19 class UploadedFile implements UploadedFileInterface
24 private $clientFileName;
25 private $clientMediaType;
27 public function __construct($filePath, $size = null, $error = UPLOAD_ERR_OK, $clientFileName = null, $clientMediaType = null)
29 $this->filePath = $filePath;
31 $this->error = $error;
32 $this->clientFileName = $clientFileName;
33 $this->clientMediaType = $clientMediaType;
36 public function getStream()
38 throw new \RuntimeException('No stream is available.');
41 public function moveTo($targetPath)
43 rename($this->filePath, $targetPath);
46 public function getSize()
51 public function getError()
56 public function getClientFilename()
58 return $this->clientFileName;
61 public function getClientMediaType()
63 return $this->clientMediaType;