@@ -67,6 +67,7 @@ public function test_upload_chunk_file_throw_chunk_response()
67
67
$ extension = pathinfo ($ originalName , PATHINFO_EXTENSION );
68
68
$ mimeType = finfo_file (finfo_open (FILEINFO_MIME_TYPE ), $ file );
69
69
$ tmpfile = $ path .'/ ' .md5 ($ originalName .$ token ).'. ' .$ extension ;
70
+ $ tmpfileExtension = FileAPI::TMPFILE_EXTENSION ;
70
71
71
72
$ start = 5242880 ;
72
73
$ end = 5767167 ;
@@ -113,7 +114,7 @@ public function test_upload_chunk_file_throw_chunk_response()
113
114
$ request ->shouldHaveReceived ('header ' )->with ('content-type ' )->once ();
114
115
$ filesystem ->shouldHaveReceived ('extension ' )->with ($ originalName )->once ();
115
116
$ request ->shouldHaveReceived ('get ' )->with ('token ' )->once ();
116
- $ filesystem ->shouldHaveReceived ('appendStream ' )->with ($ tmpfile .' .part ' , $ input , $ start )->once ();
117
+ $ filesystem ->shouldHaveReceived ('appendStream ' )->with ($ tmpfile .$ tmpfileExtension , $ input , $ start )->once ();
117
118
}
118
119
119
120
public function test_upload_chunk_file ()
@@ -136,6 +137,7 @@ public function test_upload_chunk_file()
136
137
$ extension = pathinfo ($ originalName , PATHINFO_EXTENSION );
137
138
$ mimeType = finfo_file (finfo_open (FILEINFO_MIME_TYPE ), $ file );
138
139
$ tmpfile = $ path .'/ ' .md5 ($ originalName .$ token ).'. ' .$ extension ;
140
+ $ tmpfileExtension = FileAPI::TMPFILE_EXTENSION ;
139
141
140
142
$ start = 5242880 ;
141
143
$ end = 7845180 ;
@@ -160,7 +162,7 @@ public function test_upload_chunk_file()
160
162
$ filesystem
161
163
->shouldReceive ('extension ' )->with ($ originalName )->andReturn ($ extension )
162
164
->shouldReceive ('mimeType ' )->with ($ originalName )->andReturn ($ mimeType )
163
- ->shouldReceive ('move ' )->with ($ tmpfile .' .part ' , $ tmpfile )
165
+ ->shouldReceive ('move ' )->with ($ tmpfile .$ tmpfileExtension , $ tmpfile )
164
166
->shouldReceive ('size ' )->with ($ tmpfile )->andReturn ($ total );
165
167
166
168
$ uploader = new FileAPI ($ request , $ filesystem , $ path );
@@ -179,8 +181,8 @@ public function test_upload_chunk_file()
179
181
$ filesystem ->shouldHaveReceived ('extension ' )->with ($ originalName )->once ();
180
182
$ filesystem ->shouldHaveReceived ('mimeType ' )->with ($ originalName )->once ();
181
183
$ request ->shouldHaveReceived ('get ' )->with ('token ' )->once ();
182
- $ filesystem ->shouldHaveReceived ('appendStream ' )->with ($ tmpfile .' .part ' , $ input , $ start )->once ();
183
- $ filesystem ->shouldHaveReceived ('move ' )->with ($ tmpfile .' .part ' , $ tmpfile )->once ();
184
+ $ filesystem ->shouldHaveReceived ('appendStream ' )->with ($ tmpfile .$ tmpfileExtension , $ input , $ start )->once ();
185
+ $ filesystem ->shouldHaveReceived ('move ' )->with ($ tmpfile .$ tmpfileExtension , $ tmpfile )->once ();
184
186
$ filesystem ->shouldHaveReceived ('size ' )->once ();
185
187
$ filesystem ->shouldHaveReceived ('createUploadedFile ' )->with ($ tmpfile , $ originalName , $ mimeType , $ size )->once ();
186
188
}
0 commit comments