@@ -159,7 +159,7 @@ public function provideMaxSizeExceededTests()
159
159
*/
160
160
public function testMaxSizeExceeded ($ bytesWritten , $ limit , $ sizeAsString , $ limitAsString , $ suffix )
161
161
{
162
- fseek ($ this ->file , $ bytesWritten - 1 , SEEK_SET );
162
+ fseek ($ this ->file , $ bytesWritten - 1 , \ SEEK_SET );
163
163
fwrite ($ this ->file , '0 ' );
164
164
fclose ($ this ->file );
165
165
@@ -208,7 +208,7 @@ public function provideMaxSizeNotExceededTests()
208
208
*/
209
209
public function testMaxSizeNotExceeded ($ bytesWritten , $ limit )
210
210
{
211
- fseek ($ this ->file , $ bytesWritten - 1 , SEEK_SET );
211
+ fseek ($ this ->file , $ bytesWritten - 1 , \ SEEK_SET );
212
212
fwrite ($ this ->file , '0 ' );
213
213
fclose ($ this ->file );
214
214
@@ -259,7 +259,7 @@ public function provideBinaryFormatTests()
259
259
*/
260
260
public function testBinaryFormat ($ bytesWritten , $ limit , $ binaryFormat , $ sizeAsString , $ limitAsString , $ suffix )
261
261
{
262
- fseek ($ this ->file , $ bytesWritten - 1 , SEEK_SET );
262
+ fseek ($ this ->file , $ bytesWritten - 1 , \ SEEK_SET );
263
263
fwrite ($ this ->file , '0 ' );
264
264
fclose ($ this ->file );
265
265
@@ -431,23 +431,23 @@ public function testUploadedFileError($error, $message, array $params = [], $max
431
431
public function uploadedFileErrorProvider ()
432
432
{
433
433
$ tests = [
434
- [(string ) UPLOAD_ERR_FORM_SIZE , 'uploadFormSizeErrorMessage ' ],
435
- [(string ) UPLOAD_ERR_PARTIAL , 'uploadPartialErrorMessage ' ],
436
- [(string ) UPLOAD_ERR_NO_FILE , 'uploadNoFileErrorMessage ' ],
437
- [(string ) UPLOAD_ERR_NO_TMP_DIR , 'uploadNoTmpDirErrorMessage ' ],
438
- [(string ) UPLOAD_ERR_CANT_WRITE , 'uploadCantWriteErrorMessage ' ],
439
- [(string ) UPLOAD_ERR_EXTENSION , 'uploadExtensionErrorMessage ' ],
434
+ [(string ) \ UPLOAD_ERR_FORM_SIZE , 'uploadFormSizeErrorMessage ' ],
435
+ [(string ) \ UPLOAD_ERR_PARTIAL , 'uploadPartialErrorMessage ' ],
436
+ [(string ) \ UPLOAD_ERR_NO_FILE , 'uploadNoFileErrorMessage ' ],
437
+ [(string ) \ UPLOAD_ERR_NO_TMP_DIR , 'uploadNoTmpDirErrorMessage ' ],
438
+ [(string ) \ UPLOAD_ERR_CANT_WRITE , 'uploadCantWriteErrorMessage ' ],
439
+ [(string ) \ UPLOAD_ERR_EXTENSION , 'uploadExtensionErrorMessage ' ],
440
440
];
441
441
442
442
if (class_exists ('Symfony\Component\HttpFoundation\File\UploadedFile ' )) {
443
443
// when no maxSize is specified on constraint, it should use the ini value
444
- $ tests [] = [(string ) UPLOAD_ERR_INI_SIZE , 'uploadIniSizeErrorMessage ' , [
444
+ $ tests [] = [(string ) \ UPLOAD_ERR_INI_SIZE , 'uploadIniSizeErrorMessage ' , [
445
445
'{{ limit }} ' => UploadedFile::getMaxFilesize () / 1048576 ,
446
446
'{{ suffix }} ' => 'MiB ' ,
447
447
]];
448
448
449
449
// it should use the smaller limitation (maxSize option in this case)
450
- $ tests [] = [(string ) UPLOAD_ERR_INI_SIZE , 'uploadIniSizeErrorMessage ' , [
450
+ $ tests [] = [(string ) \ UPLOAD_ERR_INI_SIZE , 'uploadIniSizeErrorMessage ' , [
451
451
'{{ limit }} ' => 1 ,
452
452
'{{ suffix }} ' => 'bytes ' ,
453
453
], '1 ' ];
@@ -460,14 +460,14 @@ public function uploadedFileErrorProvider()
460
460
461
461
// it correctly parses the maxSize option and not only uses simple string comparison
462
462
// 1000M should be bigger than the ini value
463
- $ tests [] = [(string ) UPLOAD_ERR_INI_SIZE , 'uploadIniSizeErrorMessage ' , [
463
+ $ tests [] = [(string ) \ UPLOAD_ERR_INI_SIZE , 'uploadIniSizeErrorMessage ' , [
464
464
'{{ limit }} ' => $ limit ,
465
465
'{{ suffix }} ' => $ suffix ,
466
466
], '1000M ' ];
467
467
468
468
// it correctly parses the maxSize option and not only uses simple string comparison
469
469
// 1000M should be bigger than the ini value
470
- $ tests [] = [(string ) UPLOAD_ERR_INI_SIZE , 'uploadIniSizeErrorMessage ' , [
470
+ $ tests [] = [(string ) \ UPLOAD_ERR_INI_SIZE , 'uploadIniSizeErrorMessage ' , [
471
471
'{{ limit }} ' => '0.1 ' ,
472
472
'{{ suffix }} ' => 'MB ' ,
473
473
], '100K ' ];
0 commit comments