@@ -20,7 +20,7 @@ public function test_upload_single_file()
20
20
*/
21
21
22
22
$ config = [
23
- 'chunksPath ' => __DIR__ ,
23
+ 'chunks_path ' => __DIR__ ,
24
24
];
25
25
$ request = m::spy ('Illuminate\Http\Request ' );
26
26
$ filesystem = m::spy ('Recca0120\Upload\Filesystem ' );
@@ -37,8 +37,8 @@ public function test_upload_single_file()
37
37
->shouldReceive ('file ' )->with ($ inputName )->andReturn ($ uploadedFile );
38
38
39
39
$ filesystem
40
- ->shouldReceive ('isDirectory ' )->with ($ config ['chunksPath ' ])->andReturn (false )
41
- ->shouldReceive ('files ' )->with ($ config ['chunksPath ' ])->andReturn (['file ' ])
40
+ ->shouldReceive ('isDirectory ' )->with ($ config ['chunks_path ' ])->andReturn (false )
41
+ ->shouldReceive ('files ' )->with ($ config ['chunks_path ' ])->andReturn (['file ' ])
42
42
->shouldReceive ('isFile ' )->with ('file ' )->andReturn (true )
43
43
->shouldReceive ('lastModified ' )->with ('file ' )->andReturn (-1 );
44
44
@@ -52,11 +52,11 @@ public function test_upload_single_file()
52
52
53
53
$ this ->assertSame ($ uploadedFile , $ uploader ->receive ($ inputName ));
54
54
55
- $ filesystem ->shouldHaveReceived ('isDirectory ' )->with ($ config ['chunksPath ' ])->once ();
56
- $ filesystem ->shouldHaveReceived ('makeDirectory ' )->with ($ config ['chunksPath ' ], 0777 , true , true )->once ();
55
+ $ filesystem ->shouldHaveReceived ('isDirectory ' )->with ($ config ['chunks_path ' ])->once ();
56
+ $ filesystem ->shouldHaveReceived ('makeDirectory ' )->with ($ config ['chunks_path ' ], 0777 , true , true )->once ();
57
57
$ request ->shouldHaveReceived ('header ' )->with ('content-range ' )->once ();
58
58
$ request ->shouldHaveReceived ('file ' )->with ($ inputName )->once ();
59
- $ filesystem ->shouldHaveReceived ('files ' )->with ($ config ['chunksPath ' ])->once ();
59
+ $ filesystem ->shouldHaveReceived ('files ' )->with ($ config ['chunks_path ' ])->once ();
60
60
$ filesystem ->shouldHaveReceived ('isFile ' )->with ('file ' )->once ();
61
61
$ filesystem ->shouldHaveReceived ('lastModified ' )->with ('file ' )->once ();
62
62
$ filesystem ->shouldHaveReceived ('delete ' )->with ('file ' )->once ();
@@ -71,7 +71,7 @@ public function test_upload_chunk_file_throw_chunk_response()
71
71
*/
72
72
73
73
$ config = [
74
- 'chunksPath ' => __DIR__ ,
74
+ 'chunks_path ' => __DIR__ ,
75
75
];
76
76
$ request = m::spy ('Illuminate\Http\Request ' );
77
77
$ filesystem = m::spy ('Recca0120\Upload\Filesystem ' );
@@ -83,7 +83,7 @@ public function test_upload_chunk_file_throw_chunk_response()
83
83
$ originalName = basename ($ file );
84
84
$ extension = pathinfo ($ originalName , PATHINFO_EXTENSION );
85
85
$ mimeType = finfo_file (finfo_open (FILEINFO_MIME_TYPE ), $ file );
86
- $ tmpfile = $ config ['chunksPath ' ].'/ ' .md5 ($ originalName .$ token ).'. ' .$ extension ;
86
+ $ tmpfile = $ config ['chunks_path ' ].'/ ' .md5 ($ originalName .$ token ).'. ' .$ extension ;
87
87
$ tmpfileExtension = FileAPI::TMPFILE_EXTENSION ;
88
88
89
89
$ start = 5242880 ;
@@ -107,7 +107,7 @@ public function test_upload_chunk_file_throw_chunk_response()
107
107
->shouldReceive ('get ' )->with ('token ' )->andReturn ($ token );
108
108
109
109
$ filesystem
110
- ->shouldReceive ('isDirectory ' )->with ($ config ['chunksPath ' ])->andReturn (false )
110
+ ->shouldReceive ('isDirectory ' )->with ($ config ['chunks_path ' ])->andReturn (false )
111
111
->shouldReceive ('extension ' )->andReturn ($ extension );
112
112
113
113
$ uploader = new FileAPI ($ config , $ request , $ filesystem );
@@ -126,8 +126,8 @@ public function test_upload_chunk_file_throw_chunk_response()
126
126
$ this ->assertSame ($ end , $ response ->headers ->get ('X-Last-Known-Byte ' ));
127
127
}
128
128
129
- $ filesystem ->shouldHaveReceived ('isDirectory ' )->with ($ config ['chunksPath ' ])->once ();
130
- $ filesystem ->shouldHaveReceived ('makeDirectory ' )->with ($ config ['chunksPath ' ], 0777 , true , true )->once ();
129
+ $ filesystem ->shouldHaveReceived ('isDirectory ' )->with ($ config ['chunks_path ' ])->once ();
130
+ $ filesystem ->shouldHaveReceived ('makeDirectory ' )->with ($ config ['chunks_path ' ], 0777 , true , true )->once ();
131
131
$ request ->shouldHaveReceived ('header ' )->with ('content-range ' )->once ();
132
132
$ request ->shouldHaveReceived ('get ' )->with ('name ' )->once ();
133
133
$ request ->shouldHaveReceived ('header ' )->with ('content-disposition ' )->once ();
@@ -146,7 +146,7 @@ public function test_upload_chunk_file()
146
146
*/
147
147
148
148
$ config = [
149
- 'chunksPath ' => __DIR__ ,
149
+ 'chunks_path ' => __DIR__ ,
150
150
];
151
151
$ request = m::spy ('Illuminate\Http\Request ' );
152
152
$ filesystem = m::spy ('Recca0120\Upload\Filesystem ' );
@@ -158,7 +158,7 @@ public function test_upload_chunk_file()
158
158
$ originalName = basename ($ file );
159
159
$ extension = pathinfo ($ originalName , PATHINFO_EXTENSION );
160
160
$ mimeType = finfo_file (finfo_open (FILEINFO_MIME_TYPE ), $ file );
161
- $ tmpfile = $ config ['chunksPath ' ].'/ ' .md5 ($ originalName .$ token ).'. ' .$ extension ;
161
+ $ tmpfile = $ config ['chunks_path ' ].'/ ' .md5 ($ originalName .$ token ).'. ' .$ extension ;
162
162
$ tmpfileExtension = FileAPI::TMPFILE_EXTENSION ;
163
163
164
164
$ start = 5242880 ;
@@ -182,12 +182,12 @@ public function test_upload_chunk_file()
182
182
->shouldReceive ('get ' )->with ('token ' )->andReturn ($ token );
183
183
184
184
$ filesystem
185
- ->shouldReceive ('isDirectory ' )->with ($ config ['chunksPath ' ])->andReturn (false )
185
+ ->shouldReceive ('isDirectory ' )->with ($ config ['chunks_path ' ])->andReturn (false )
186
186
->shouldReceive ('extension ' )->with ($ originalName )->andReturn ($ extension )
187
187
->shouldReceive ('mimeType ' )->with ($ originalName )->andReturn ($ mimeType )
188
188
->shouldReceive ('move ' )->with ($ tmpfile .$ tmpfileExtension , $ tmpfile )
189
189
->shouldReceive ('size ' )->with ($ tmpfile )->andReturn ($ total )
190
- ->shouldReceive ('files ' )->with ($ config ['chunksPath ' ])->andReturn (['file ' ])
190
+ ->shouldReceive ('files ' )->with ($ config ['chunks_path ' ])->andReturn (['file ' ])
191
191
->shouldReceive ('isFile ' )->with ('file ' )->andReturn (true )
192
192
->shouldReceive ('lastModified ' )->with ('file ' )->andReturn (-1 );
193
193
@@ -201,8 +201,8 @@ public function test_upload_chunk_file()
201
201
202
202
$ uploader ->receive ($ inputName );
203
203
204
- $ filesystem ->shouldHaveReceived ('isDirectory ' )->with ($ config ['chunksPath ' ])->once ();
205
- $ filesystem ->shouldHaveReceived ('makeDirectory ' )->with ($ config ['chunksPath ' ], 0777 , true , true )->once ();
204
+ $ filesystem ->shouldHaveReceived ('isDirectory ' )->with ($ config ['chunks_path ' ])->once ();
205
+ $ filesystem ->shouldHaveReceived ('makeDirectory ' )->with ($ config ['chunks_path ' ], 0777 , true , true )->once ();
206
206
$ request ->shouldHaveReceived ('header ' )->with ('content-range ' )->once ();
207
207
$ request ->shouldHaveReceived ('get ' )->with ('name ' )->once ();
208
208
$ request ->shouldHaveReceived ('header ' )->with ('content-disposition ' )->once ();
@@ -213,7 +213,7 @@ public function test_upload_chunk_file()
213
213
$ filesystem ->shouldHaveReceived ('move ' )->with ($ tmpfile .$ tmpfileExtension , $ tmpfile )->once ();
214
214
$ filesystem ->shouldHaveReceived ('size ' )->once ();
215
215
$ filesystem ->shouldHaveReceived ('createUploadedFile ' )->with ($ tmpfile , $ originalName , $ mimeType , $ size )->once ();
216
- $ filesystem ->shouldHaveReceived ('files ' )->with ($ config ['chunksPath ' ])->once ();
216
+ $ filesystem ->shouldHaveReceived ('files ' )->with ($ config ['chunks_path ' ])->once ();
217
217
$ filesystem ->shouldHaveReceived ('isFile ' )->with ('file ' )->once ();
218
218
$ filesystem ->shouldHaveReceived ('lastModified ' )->with ('file ' )->once ();
219
219
$ filesystem ->shouldHaveReceived ('delete ' )->with ('file ' )->once ();
@@ -228,7 +228,7 @@ public function test_completed_response()
228
228
*/
229
229
230
230
$ config = [
231
- 'chunksPath ' => __DIR__ ,
231
+ 'chunks_path ' => __DIR__ ,
232
232
];
233
233
$ request = m::spy ('Illuminate\Http\Request ' );
234
234
$ filesystem = m::spy ('Recca0120\Upload\Filesystem ' );
@@ -260,7 +260,7 @@ public function test_delete_uploaded_file()
260
260
*/
261
261
262
262
$ config = [
263
- 'chunksPath ' => __DIR__ ,
263
+ 'chunks_path ' => __DIR__ ,
264
264
];
265
265
$ request = m::spy ('Illuminate\Http\Request ' );
266
266
$ filesystem = m::spy ('Recca0120\Upload\Filesystem ' );
0 commit comments