File tree 2 files changed +27
-2
lines changed
src/Illuminate/Http/Testing
2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,31 @@ public function __construct($name, $tempFile)
45
45
);
46
46
}
47
47
48
+ /**
49
+ * Create a new fake file.
50
+ *
51
+ * @param string $name
52
+ * @param int $kilobytes
53
+ * @return \Illuminate\Http\Testing\File
54
+ */
55
+ public static function create ($ name , $ kilobytes = 0 )
56
+ {
57
+ return (new FileFactory )->create ($ name , $ kilobytes );
58
+ }
59
+
60
+ /**
61
+ * Create a new fake image.
62
+ *
63
+ * @param string $name
64
+ * @param int $width
65
+ * @param int $height
66
+ * @return \Illuminate\Http\Testing\File
67
+ */
68
+ public static function image ($ name , $ width = 10 , $ height = 10 )
69
+ {
70
+ return (new FileFactory )->image ($ name , $ width , $ height );
71
+ }
72
+
48
73
/**
49
74
* Set the "size" of the file in kilobytes.
50
75
*
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class FileFactory
11
11
* @param int $kilobytes
12
12
* @return \Illuminate\Http\Testing\File
13
13
*/
14
- public function create ($ name , $ kilobytes )
14
+ public function create ($ name , $ kilobytes = 0 )
15
15
{
16
16
return tap (new File ($ name , tmpfile ()), function ($ file ) use ($ kilobytes ) {
17
17
$ file ->sizeToReport = $ kilobytes * 1024 ;
@@ -22,7 +22,7 @@ public function create($name, $kilobytes)
22
22
* Create a new fake image.
23
23
*
24
24
* @param string $name
25
- * @param int $height
25
+ * @param int $width
26
26
* @param int $height
27
27
* @return \Illuminate\Http\Testing\File
28
28
*/
You can’t perform that action at this time.
0 commit comments