File tree Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -175,9 +175,9 @@ public function moveTo($targetPath)
175175 * the file in the $_FILES array if available, as PHP calculates this based
176176 * on the actual size transmitted.
177177 *
178- * @return null |int the file size in bytes or null if unknown
178+ * @return false |int the file size in bytes or null if unknown
179179 */
180- public function getSize ()
180+ public function getSize (): int | false
181181 {
182182 return $ this ->size ;
183183 }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+ /**
5+ * This file is part of Hyperf.
6+ *
7+ * @link https://www.hyperf.io
8+ * @document https://hyperf.wiki
9+ 10+ * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
11+ */
12+ namespace HyperfTest \HttpMessage \Upload ;
13+
14+ use Hyperf \HttpMessage \Upload \UploadedFile ;
15+ use Mockery ;
16+ use PHPUnit \Framework \TestCase ;
17+
18+ /**
19+ * @internal
20+ * @coversNothing
21+ */
22+ class UploadedFileTest extends TestCase
23+ {
24+ protected function tearDown (): void
25+ {
26+ Mockery::close ();
27+ }
28+
29+ public function testGetSize ()
30+ {
31+ $ file = new UploadedFile ('' , 10 , 0 );
32+
33+ $ this ->assertSame (10 , $ file ->getSize ());
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments