Skip to content

Commit e4cf458

Browse files
author
Amrouche Hamza
committed
[HttpFoundation] Incorrect documentation and method name for UploadedFile::getClientSize()
1 parent a4f041e commit e4cf458

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Tests/CompoundFormTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ public function testSubmitPostOrPutRequest($method)
609609
'author' => array(
610610
'error' => array('image' => UPLOAD_ERR_OK),
611611
'name' => array('image' => 'upload.png'),
612-
'size' => array('image' => 123),
612+
'size' => array('image' => null),
613613
'tmp_name' => array('image' => $path),
614614
'type' => array('image' => 'image/png'),
615615
),
@@ -630,7 +630,7 @@ public function testSubmitPostOrPutRequest($method)
630630

631631
$form->handleRequest($request);
632632

633-
$file = new UploadedFile($path, 'upload.png', 'image/png', 123, UPLOAD_ERR_OK);
633+
$file = new UploadedFile($path, 'upload.png', 'image/png', null, UPLOAD_ERR_OK);
634634

635635
$this->assertEquals('Bernhard', $form['name']->getData());
636636
$this->assertEquals($file, $form['image']->getData());
@@ -655,7 +655,7 @@ public function testSubmitPostOrPutRequestWithEmptyRootFormName($method)
655655
'image' => array(
656656
'error' => UPLOAD_ERR_OK,
657657
'name' => 'upload.png',
658-
'size' => 123,
658+
'size' => null,
659659
'tmp_name' => $path,
660660
'type' => 'image/png',
661661
),
@@ -676,7 +676,7 @@ public function testSubmitPostOrPutRequestWithEmptyRootFormName($method)
676676

677677
$form->handleRequest($request);
678678

679-
$file = new UploadedFile($path, 'upload.png', 'image/png', 123, UPLOAD_ERR_OK);
679+
$file = new UploadedFile($path, 'upload.png', 'image/png', null, UPLOAD_ERR_OK);
680680

681681
$this->assertEquals('Bernhard', $form['name']->getData());
682682
$this->assertEquals($file, $form['image']->getData());
@@ -697,7 +697,7 @@ public function testSubmitPostOrPutRequestWithSingleChildForm($method)
697697
'image' => array(
698698
'error' => UPLOAD_ERR_OK,
699699
'name' => 'upload.png',
700-
'size' => 123,
700+
'size' => null,
701701
'tmp_name' => $path,
702702
'type' => 'image/png',
703703
),
@@ -714,7 +714,7 @@ public function testSubmitPostOrPutRequestWithSingleChildForm($method)
714714

715715
$form->handleRequest($request);
716716

717-
$file = new UploadedFile($path, 'upload.png', 'image/png', 123, UPLOAD_ERR_OK);
717+
$file = new UploadedFile($path, 'upload.png', 'image/png', null, UPLOAD_ERR_OK);
718718

719719
$this->assertEquals($file, $form->getData());
720720

Tests/Extension/Core/Type/FileTypeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,15 @@ public function requestHandlerProvider()
188188
private function createUploadedFileMock(RequestHandlerInterface $requestHandler, $path, $originalName)
189189
{
190190
if ($requestHandler instanceof HttpFoundationRequestHandler) {
191-
return new UploadedFile($path, $originalName, null, 10, null, true);
191+
return new UploadedFile($path, $originalName, null, null, null, true);
192192
}
193193

194194
return array(
195195
'name' => $originalName,
196196
'error' => 0,
197197
'type' => 'text/plain',
198198
'tmp_name' => $path,
199-
'size' => 10,
199+
'size' => null,
200200
);
201201
}
202202
}

0 commit comments

Comments
 (0)