Skip to content

Commit 3117c85

Browse files
Amrouche Hamzaxabbuh
authored andcommitted
[HttpFoundation] we should not pass size on FileBag
1 parent c3736ce commit 3117c85

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Tests/Constraints/FileValidatorTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ public function testValidFile()
8383

8484
public function testValidUploadedfile()
8585
{
86-
$file = new UploadedFile($this->path, 'originalName', null, null, null, true);
86+
file_put_contents($this->path, '1');
87+
$file = new UploadedFile($this->path, 'originalName', null, null, true);
8788
$this->validator->validate($file, new File());
8889

8990
$this->assertNoViolation();
@@ -411,7 +412,8 @@ public function testDisallowEmpty()
411412
*/
412413
public function testUploadedFileError($error, $message, array $params = array(), $maxSize = null)
413414
{
414-
$file = new UploadedFile('/path/to/file', 'originalName', 'mime', null, $error);
415+
touch('/tmp/file');
416+
$file = new UploadedFile('/tmp/file', 'originalName', 'mime', $error);
415417

416418
$constraint = new File(array(
417419
$message => 'myMessage',

0 commit comments

Comments
 (0)