15
15
use Symfony \Component \HttpFoundation \File \Exception \CannotWriteFileException ;
16
16
use Symfony \Component \HttpFoundation \File \Exception \ExtensionFileException ;
17
17
use Symfony \Component \HttpFoundation \File \Exception \FileException ;
18
+ use Symfony \Component \HttpFoundation \File \Exception \FileNotFoundException ;
18
19
use Symfony \Component \HttpFoundation \File \Exception \FormSizeFileException ;
19
20
use Symfony \Component \HttpFoundation \File \Exception \IniSizeFileException ;
20
21
use Symfony \Component \HttpFoundation \File \Exception \NoFileException ;
@@ -33,7 +34,7 @@ protected function setUp(): void
33
34
34
35
public function testConstructWhenFileNotExists ()
35
36
{
36
- $ this ->expectException (\ Symfony \ Component \ HttpFoundation \ File \ Exception \ FileNotFoundException::class);
37
+ $ this ->expectException (FileNotFoundException::class);
37
38
38
39
new UploadedFile (
39
40
__DIR__ .'/Fixtures/not_here ' ,
@@ -358,13 +359,16 @@ public function testGetMaxFilesize()
358
359
{
359
360
$ size = UploadedFile::getMaxFilesize ();
360
361
361
- $ this ->assertIsInt ($ size );
362
+ if ($ size > \PHP_INT_MAX ) {
363
+ $ this ->assertIsFloat ($ size );
364
+ } else {
365
+ $ this ->assertIsInt ($ size );
366
+ }
367
+
362
368
$ this ->assertGreaterThan (0 , $ size );
363
369
364
370
if (0 === (int ) ini_get ('post_max_size ' ) && 0 === (int ) ini_get ('upload_max_filesize ' )) {
365
371
$ this ->assertSame (\PHP_INT_MAX , $ size );
366
- } else {
367
- $ this ->assertLessThan (\PHP_INT_MAX , $ size );
368
372
}
369
373
}
370
374
}
0 commit comments