File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed
src/Illuminate/Http/Testing Expand file tree Collapse file tree 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)
4545 );
4646 }
4747
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+
4873 /**
4974 * Set the "size" of the file in kilobytes.
5075 *
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class FileFactory
1111 * @param int $kilobytes
1212 * @return \Illuminate\Http\Testing\File
1313 */
14- public function create ($ name , $ kilobytes )
14+ public function create ($ name , $ kilobytes = 0 )
1515 {
1616 return tap (new File ($ name , tmpfile ()), function ($ file ) use ($ kilobytes ) {
1717 $ file ->sizeToReport = $ kilobytes * 1024 ;
@@ -22,7 +22,7 @@ public function create($name, $kilobytes)
2222 * Create a new fake image.
2323 *
2424 * @param string $name
25- * @param int $height
25+ * @param int $width
2626 * @param int $height
2727 * @return \Illuminate\Http\Testing\File
2828 */
You can’t perform that action at this time.
0 commit comments