ikechukwukalu /
clamavfileupload
| 1 | <?php |
||||||||
| 2 | |||||||||
| 3 | namespace Ikechukwukalu\Clamavfileupload\Tests; |
||||||||
| 4 | |||||||||
| 5 | use Illuminate\Database\Eloquent\Collection; |
||||||||
| 6 | use Illuminate\Foundation\Testing\RefreshDatabase; |
||||||||
| 7 | use Illuminate\Http\Request; |
||||||||
| 8 | use Illuminate\Support\Facades\Event; |
||||||||
| 9 | use Illuminate\Support\Facades\Storage; |
||||||||
| 10 | use Ikechukwukalu\Clamavfileupload\Facades\Services\FileUpload; |
||||||||
| 11 | use Ikechukwukalu\Clamavfileupload\Facades\Services\NoClamavFileUpload; |
||||||||
| 12 | use Ikechukwukalu\Clamavfileupload\Facades\Services\QueuedFileUpload; |
||||||||
| 13 | use Ikechukwukalu\Clamavfileupload\Events\ClamavQueuedFileScan; |
||||||||
| 14 | use Ikechukwukalu\Clamavfileupload\Listeners\ClamavFileUpload; |
||||||||
| 15 | use Ikechukwukalu\Clamavfileupload\Models\FileUpload as FileUploadModel; |
||||||||
| 16 | use Symfony\Component\HttpFoundation\File\UploadedFile; |
||||||||
| 17 | |||||||||
| 18 | class FileUploadTest extends TestCase |
||||||||
| 19 | { |
||||||||
| 20 | use RefreshDatabase; |
||||||||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||||||||
| 21 | |||||||||
| 22 | public function test_file_upload_run_is_true(): void |
||||||||
| 23 | { |
||||||||
| 24 | Storage::fake(config('clamavfileupload.disk')); |
||||||||
| 25 | |||||||||
| 26 | $file = __DIR__ . '/file/lorem-ipsum.pdf'; |
||||||||
| 27 | if (! is_dir($tmpDir = __DIR__ . '/tmp')) { |
||||||||
| 28 | mkdir($tmpDir, 0755, true); |
||||||||
| 29 | } |
||||||||
| 30 | |||||||||
| 31 | $tmpFile = $tmpDir . '/lorem-ipsum.pdf'; |
||||||||
| 32 | $this->assertTrue(copy($file, $tmpFile)); |
||||||||
| 33 | |||||||||
| 34 | $request = new Request; |
||||||||
| 35 | $files = []; |
||||||||
| 36 | $extension = explode('.', $tmpFile)[1]; |
||||||||
| 37 | $files[] = new UploadedFile($tmpFile, ".{$extension}"); |
||||||||
| 38 | $input = config('clamavfileupload.input', 'file'); |
||||||||
| 39 | $request->files->set($input, $files); |
||||||||
| 40 | |||||||||
| 41 | $this->assertTrue($request instanceof Request); |
||||||||
| 42 | |||||||||
| 43 | $settings = [ |
||||||||
| 44 | 'folder' => 'docs', |
||||||||
| 45 | 'name' => 'Resumes' |
||||||||
| 46 | ]; |
||||||||
| 47 | |||||||||
| 48 | $response = FileUpload::uploadFiles($request, $settings); |
||||||||
|
0 ignored issues
–
show
The method
uploadFiles() does not exist on Ikechukwukalu\Clamavfile...des\Services\FileUpload. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 49 | $this->assertTrue($response instanceof Collection || is_bool($response)); |
||||||||
| 50 | } |
||||||||
| 51 | |||||||||
| 52 | public function test_queue_file_upload_run_is_true(): void |
||||||||
| 53 | { |
||||||||
| 54 | Storage::fake(config('clamavfileupload.disk')); |
||||||||
| 55 | |||||||||
| 56 | $file = __DIR__ . '/file/lorem-ipsum.pdf'; |
||||||||
| 57 | if (! is_dir($tmpDir = __DIR__ . '/tmp')) { |
||||||||
| 58 | mkdir($tmpDir, 0755, true); |
||||||||
| 59 | } |
||||||||
| 60 | |||||||||
| 61 | $tmpFile = $tmpDir . '/lorem-ipsum.pdf'; |
||||||||
| 62 | $this->assertTrue(copy($file, $tmpFile)); |
||||||||
| 63 | |||||||||
| 64 | $request = new Request; |
||||||||
| 65 | $files = []; |
||||||||
| 66 | $extension = explode('.', $tmpFile)[1]; |
||||||||
| 67 | $files[] = new UploadedFile($tmpFile, ".{$extension}"); |
||||||||
| 68 | $input = config('clamavfileupload.input', 'file'); |
||||||||
| 69 | $request->files->set($input, $files); |
||||||||
| 70 | |||||||||
| 71 | $this->assertTrue($request instanceof Request); |
||||||||
| 72 | |||||||||
| 73 | $settings = [ |
||||||||
| 74 | 'folder' => 'docs', |
||||||||
| 75 | 'name' => 'Resumes' |
||||||||
| 76 | ]; |
||||||||
| 77 | |||||||||
| 78 | $event = Event::fake(); |
||||||||
| 79 | |||||||||
| 80 | $response = QueuedFileUpload::uploadFiles($request, $settings); |
||||||||
|
0 ignored issues
–
show
The method
uploadFiles() does not exist on Ikechukwukalu\Clamavfile...rvices\QueuedFileUpload. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 81 | $this->assertTrue($response instanceof Collection || is_bool($response)); |
||||||||
| 82 | |||||||||
| 83 | $event->assertListening( |
||||||||
| 84 | ClamavQueuedFileScan::class, |
||||||||
| 85 | ClamavFileUpload::class |
||||||||
| 86 | ); |
||||||||
| 87 | } |
||||||||
| 88 | |||||||||
| 89 | public function test_no_clamav_file_upload_run_is_true(): void |
||||||||
| 90 | { |
||||||||
| 91 | Storage::fake(config('clamavfileupload.disk')); |
||||||||
| 92 | |||||||||
| 93 | $file = __DIR__ . '/file/lorem-ipsum.pdf'; |
||||||||
| 94 | if (! is_dir($tmpDir = __DIR__ . '/tmp')) { |
||||||||
| 95 | mkdir($tmpDir, 0755, true); |
||||||||
| 96 | } |
||||||||
| 97 | |||||||||
| 98 | $tmpFile = $tmpDir . '/lorem-ipsum.pdf'; |
||||||||
| 99 | $this->assertTrue(copy($file, $tmpFile)); |
||||||||
| 100 | |||||||||
| 101 | $request = new Request; |
||||||||
| 102 | $files = []; |
||||||||
| 103 | $extension = explode('.', $tmpFile)[1]; |
||||||||
| 104 | $files[] = new UploadedFile($tmpFile, ".{$extension}"); |
||||||||
| 105 | $input = config('clamavfileupload.input', 'file'); |
||||||||
| 106 | $request->files->set($input, $files); |
||||||||
| 107 | |||||||||
| 108 | $this->assertTrue($request instanceof Request); |
||||||||
| 109 | |||||||||
| 110 | $settings = [ |
||||||||
| 111 | 'folder' => 'docs', |
||||||||
| 112 | 'name' => 'Resumes' |
||||||||
| 113 | ]; |
||||||||
| 114 | |||||||||
| 115 | $response = NoClamavFileUpload::uploadFiles($request, $settings); |
||||||||
|
0 ignored issues
–
show
The method
uploadFiles() does not exist on Ikechukwukalu\Clamavfile...ices\NoClamavFileUpload. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 116 | $this->assertTrue($response instanceof Collection); |
||||||||
| 117 | } |
||||||||
| 118 | |||||||||
| 119 | public function test_delete_all_for_file_uploaded_run_is_true(): void |
||||||||
| 120 | { |
||||||||
| 121 | Storage::fake(config('clamavfileupload.disk')); |
||||||||
| 122 | |||||||||
| 123 | $file = __DIR__ . '/file/lorem-ipsum.pdf'; |
||||||||
| 124 | if (! is_dir($tmpDir = __DIR__ . '/tmp')) { |
||||||||
| 125 | mkdir($tmpDir, 0755, true); |
||||||||
| 126 | } |
||||||||
| 127 | |||||||||
| 128 | $tmpFile = $tmpDir . '/lorem-ipsum.pdf'; |
||||||||
| 129 | $this->assertTrue(copy($file, $tmpFile)); |
||||||||
| 130 | |||||||||
| 131 | $request = new Request; |
||||||||
| 132 | $files = []; |
||||||||
| 133 | $extension = explode('.', $tmpFile)[1]; |
||||||||
| 134 | $files[] = new UploadedFile($tmpFile, ".{$extension}"); |
||||||||
| 135 | $input = config('clamavfileupload.input', 'file'); |
||||||||
| 136 | $request->files->set($input, $files); |
||||||||
| 137 | |||||||||
| 138 | $this->assertTrue($request instanceof Request); |
||||||||
| 139 | |||||||||
| 140 | $settings = [ |
||||||||
| 141 | 'folder' => 'docs', |
||||||||
| 142 | 'name' => 'Resumes' |
||||||||
| 143 | ]; |
||||||||
| 144 | |||||||||
| 145 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 146 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 147 | $this->assertTrue($response instanceof Collection); |
||||||||
| 148 | |||||||||
| 149 | $fileUpload::deleteAll($fileUpload::getRef()); |
||||||||
|
0 ignored issues
–
show
The method
getRef() does not exist on Ikechukwukalu\Clamavfile...ices\NoClamavFileUpload. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
The method
deleteAll() does not exist on Ikechukwukalu\Clamavfile...ices\NoClamavFileUpload. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 150 | } |
||||||||
| 151 | |||||||||
| 152 | public function test_delete_multiple_for_file_uploaded_run_is_true(): void |
||||||||
| 153 | { |
||||||||
| 154 | Storage::fake(config('clamavfileupload.disk')); |
||||||||
| 155 | |||||||||
| 156 | $file = __DIR__ . '/file/lorem-ipsum.pdf'; |
||||||||
| 157 | if (! is_dir($tmpDir = __DIR__ . '/tmp')) { |
||||||||
| 158 | mkdir($tmpDir, 0755, true); |
||||||||
| 159 | } |
||||||||
| 160 | |||||||||
| 161 | $tmpFile = $tmpDir . '/lorem-ipsum.pdf'; |
||||||||
| 162 | $this->assertTrue(copy($file, $tmpFile)); |
||||||||
| 163 | |||||||||
| 164 | $request = new Request; |
||||||||
| 165 | $files = []; |
||||||||
| 166 | $extension = explode('.', $tmpFile)[1]; |
||||||||
| 167 | $files[] = new UploadedFile($tmpFile, ".{$extension}"); |
||||||||
| 168 | $input = config('clamavfileupload.input', 'file'); |
||||||||
| 169 | $request->files->set($input, $files); |
||||||||
| 170 | |||||||||
| 171 | $this->assertTrue($request instanceof Request); |
||||||||
| 172 | |||||||||
| 173 | $settings = [ |
||||||||
| 174 | 'folder' => 'docs', |
||||||||
| 175 | 'name' => 'Resumes' |
||||||||
| 176 | ]; |
||||||||
| 177 | |||||||||
| 178 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 179 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 180 | $this->assertTrue($response instanceof Collection); |
||||||||
| 181 | |||||||||
| 182 | $fileUpload::deleteMultiple([$response[0]->id], $fileUpload::getRef()); |
||||||||
|
0 ignored issues
–
show
The method
deleteMultiple() does not exist on Ikechukwukalu\Clamavfile...ices\NoClamavFileUpload. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 183 | |||||||||
| 184 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 185 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 186 | $this->assertTrue($response instanceof Collection); |
||||||||
| 187 | |||||||||
| 188 | $fileUpload::deleteMultiple([$response[0]->id]); |
||||||||
| 189 | } |
||||||||
| 190 | |||||||||
| 191 | public function test_delete_one_for_file_uploaded_run_is_true(): void |
||||||||
| 192 | { |
||||||||
| 193 | Storage::fake(config('clamavfileupload.disk')); |
||||||||
| 194 | |||||||||
| 195 | $file = __DIR__ . '/file/lorem-ipsum.pdf'; |
||||||||
| 196 | if (! is_dir($tmpDir = __DIR__ . '/tmp')) { |
||||||||
| 197 | mkdir($tmpDir, 0755, true); |
||||||||
| 198 | } |
||||||||
| 199 | |||||||||
| 200 | $tmpFile = $tmpDir . '/lorem-ipsum.pdf'; |
||||||||
| 201 | $this->assertTrue(copy($file, $tmpFile)); |
||||||||
| 202 | |||||||||
| 203 | $request = new Request; |
||||||||
| 204 | $files = []; |
||||||||
| 205 | $extension = explode('.', $tmpFile)[1]; |
||||||||
| 206 | $files[] = new UploadedFile($tmpFile, ".{$extension}"); |
||||||||
| 207 | $input = config('clamavfileupload.input', 'file'); |
||||||||
| 208 | $request->files->set($input, $files); |
||||||||
| 209 | |||||||||
| 210 | $this->assertTrue($request instanceof Request); |
||||||||
| 211 | |||||||||
| 212 | $settings = [ |
||||||||
| 213 | 'folder' => 'docs', |
||||||||
| 214 | 'name' => 'Resumes' |
||||||||
| 215 | ]; |
||||||||
| 216 | |||||||||
| 217 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 218 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 219 | $this->assertTrue($response instanceof Collection); |
||||||||
| 220 | |||||||||
| 221 | $fileUpload::deleteOne($response[0]->id, $fileUpload::getRef()); |
||||||||
|
0 ignored issues
–
show
The method
deleteOne() does not exist on Ikechukwukalu\Clamavfile...ices\NoClamavFileUpload. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 222 | |||||||||
| 223 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 224 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 225 | $this->assertTrue($response instanceof Collection); |
||||||||
| 226 | |||||||||
| 227 | $fileUpload::deleteOne($response[0]->id); |
||||||||
| 228 | } |
||||||||
| 229 | |||||||||
| 230 | public function test_force_delete_all_for_file_uploaded_run_is_true(): void |
||||||||
| 231 | { |
||||||||
| 232 | Storage::fake(config('clamavfileupload.disk')); |
||||||||
| 233 | |||||||||
| 234 | $file = __DIR__ . '/file/lorem-ipsum.pdf'; |
||||||||
| 235 | if (! is_dir($tmpDir = __DIR__ . '/tmp')) { |
||||||||
| 236 | mkdir($tmpDir, 0755, true); |
||||||||
| 237 | } |
||||||||
| 238 | |||||||||
| 239 | $tmpFile = $tmpDir . '/lorem-ipsum.pdf'; |
||||||||
| 240 | $this->assertTrue(copy($file, $tmpFile)); |
||||||||
| 241 | |||||||||
| 242 | $request = new Request; |
||||||||
| 243 | $files = []; |
||||||||
| 244 | $extension = explode('.', $tmpFile)[1]; |
||||||||
| 245 | $files[] = new UploadedFile($tmpFile, ".{$extension}"); |
||||||||
| 246 | $input = config('clamavfileupload.input', 'file'); |
||||||||
| 247 | $request->files->set($input, $files); |
||||||||
| 248 | |||||||||
| 249 | $this->assertTrue($request instanceof Request); |
||||||||
| 250 | |||||||||
| 251 | $settings = [ |
||||||||
| 252 | 'folder' => 'docs', |
||||||||
| 253 | 'name' => 'Resumes' |
||||||||
| 254 | ]; |
||||||||
| 255 | |||||||||
| 256 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 257 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 258 | $this->assertTrue($response instanceof Collection); |
||||||||
| 259 | |||||||||
| 260 | $fileUpload::forceDeleteAll($fileUpload::getRef()); |
||||||||
|
0 ignored issues
–
show
The method
forceDeleteAll() does not exist on Ikechukwukalu\Clamavfile...ices\NoClamavFileUpload. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 261 | } |
||||||||
| 262 | |||||||||
| 263 | public function test_force_delete_multiple_for_file_uploaded_run_is_true(): void |
||||||||
| 264 | { |
||||||||
| 265 | Storage::fake(config('clamavfileupload.disk')); |
||||||||
| 266 | |||||||||
| 267 | $file = __DIR__ . '/file/lorem-ipsum.pdf'; |
||||||||
| 268 | if (! is_dir($tmpDir = __DIR__ . '/tmp')) { |
||||||||
| 269 | mkdir($tmpDir, 0755, true); |
||||||||
| 270 | } |
||||||||
| 271 | |||||||||
| 272 | $tmpFile = $tmpDir . '/lorem-ipsum.pdf'; |
||||||||
| 273 | $this->assertTrue(copy($file, $tmpFile)); |
||||||||
| 274 | |||||||||
| 275 | $request = new Request; |
||||||||
| 276 | $files = []; |
||||||||
| 277 | $extension = explode('.', $tmpFile)[1]; |
||||||||
| 278 | $files[] = new UploadedFile($tmpFile, ".{$extension}"); |
||||||||
| 279 | $input = config('clamavfileupload.input', 'file'); |
||||||||
| 280 | $request->files->set($input, $files); |
||||||||
| 281 | |||||||||
| 282 | $this->assertTrue($request instanceof Request); |
||||||||
| 283 | |||||||||
| 284 | $settings = [ |
||||||||
| 285 | 'folder' => 'docs', |
||||||||
| 286 | 'name' => 'Resumes' |
||||||||
| 287 | ]; |
||||||||
| 288 | |||||||||
| 289 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 290 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 291 | $this->assertTrue($response instanceof Collection); |
||||||||
| 292 | |||||||||
| 293 | $fileUpload::forceDeleteMultiple([$response[0]->id], $fileUpload::getRef()); |
||||||||
|
0 ignored issues
–
show
The method
forceDeleteMultiple() does not exist on Ikechukwukalu\Clamavfile...ices\NoClamavFileUpload. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 294 | |||||||||
| 295 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 296 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 297 | $this->assertTrue($response instanceof Collection); |
||||||||
| 298 | |||||||||
| 299 | $fileUpload::forceDeleteMultiple([$response[0]->id]); |
||||||||
| 300 | } |
||||||||
| 301 | |||||||||
| 302 | public function test_force_delete_one_for_file_uploaded_run_is_true(): void |
||||||||
| 303 | { |
||||||||
| 304 | Storage::fake(config('clamavfileupload.disk')); |
||||||||
| 305 | |||||||||
| 306 | $file = __DIR__ . '/file/lorem-ipsum.pdf'; |
||||||||
| 307 | if (! is_dir($tmpDir = __DIR__ . '/tmp')) { |
||||||||
| 308 | mkdir($tmpDir, 0755, true); |
||||||||
| 309 | } |
||||||||
| 310 | |||||||||
| 311 | $tmpFile = $tmpDir . '/lorem-ipsum.pdf'; |
||||||||
| 312 | $this->assertTrue(copy($file, $tmpFile)); |
||||||||
| 313 | |||||||||
| 314 | $request = new Request; |
||||||||
| 315 | $files = []; |
||||||||
| 316 | $extension = explode('.', $tmpFile)[1]; |
||||||||
| 317 | $files[] = new UploadedFile($tmpFile, ".{$extension}"); |
||||||||
| 318 | $input = config('clamavfileupload.input', 'file'); |
||||||||
| 319 | $request->files->set($input, $files); |
||||||||
| 320 | |||||||||
| 321 | $this->assertTrue($request instanceof Request); |
||||||||
| 322 | |||||||||
| 323 | $settings = [ |
||||||||
| 324 | 'folder' => 'docs', |
||||||||
| 325 | 'name' => 'Resumes' |
||||||||
| 326 | ]; |
||||||||
| 327 | |||||||||
| 328 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 329 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 330 | $this->assertTrue($response instanceof Collection); |
||||||||
| 331 | |||||||||
| 332 | $fileUpload::forceDeleteOne($response[0]->id, $fileUpload::getRef()); |
||||||||
|
0 ignored issues
–
show
The method
forceDeleteOne() does not exist on Ikechukwukalu\Clamavfile...ices\NoClamavFileUpload. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 333 | |||||||||
| 334 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 335 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 336 | $this->assertTrue($response instanceof Collection); |
||||||||
| 337 | |||||||||
| 338 | $fileUpload::forceDeleteOne($response[0]->id); |
||||||||
| 339 | } |
||||||||
| 340 | |||||||||
| 341 | public function test_get_deleted_files_is_true(): void |
||||||||
| 342 | { |
||||||||
| 343 | Storage::fake(config('clamavfileupload.disk')); |
||||||||
| 344 | |||||||||
| 345 | $file = __DIR__ . '/file/lorem-ipsum.pdf'; |
||||||||
| 346 | if (! is_dir($tmpDir = __DIR__ . '/tmp')) { |
||||||||
| 347 | mkdir($tmpDir, 0755, true); |
||||||||
| 348 | } |
||||||||
| 349 | |||||||||
| 350 | $tmpFile = $tmpDir . '/lorem-ipsum.pdf'; |
||||||||
| 351 | $this->assertTrue(copy($file, $tmpFile)); |
||||||||
| 352 | |||||||||
| 353 | $request = new Request; |
||||||||
| 354 | $files = []; |
||||||||
| 355 | $extension = explode('.', $tmpFile)[1]; |
||||||||
| 356 | $files[] = new UploadedFile($tmpFile, ".{$extension}"); |
||||||||
| 357 | $input = config('clamavfileupload.input', 'file'); |
||||||||
| 358 | $request->files->set($input, $files); |
||||||||
| 359 | |||||||||
| 360 | $this->assertTrue($request instanceof Request); |
||||||||
| 361 | |||||||||
| 362 | $settings = [ |
||||||||
| 363 | 'folder' => 'docs', |
||||||||
| 364 | 'name' => 'Resumes' |
||||||||
| 365 | ]; |
||||||||
| 366 | |||||||||
| 367 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 368 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 369 | $this->assertTrue($response instanceof Collection); |
||||||||
| 370 | $this->assertTrue($fileUpload::deleteAll($fileUpload::getRef())); |
||||||||
| 371 | $response = $fileUpload::getFiles(); |
||||||||
|
0 ignored issues
–
show
The method
getFiles() does not exist on Ikechukwukalu\Clamavfile...ices\NoClamavFileUpload. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 372 | $this->assertTrue($response instanceof Collection); |
||||||||
| 373 | |||||||||
| 374 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 375 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 376 | $this->assertTrue($response instanceof Collection); |
||||||||
| 377 | $response = $fileUpload::getFiles($fileUpload::getRef(), $response[0]->id); |
||||||||
| 378 | $this->assertTrue($response instanceof FileUploadModel); |
||||||||
| 379 | |||||||||
| 380 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 381 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 382 | $this->assertTrue($response instanceof Collection); |
||||||||
| 383 | $response = $fileUpload::getFiles($fileUpload::getRef(), $response->pluck('id')->toArray()); |
||||||||
| 384 | $this->assertTrue($response instanceof Collection); |
||||||||
| 385 | |||||||||
| 386 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 387 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 388 | $this->assertTrue($response instanceof Collection); |
||||||||
| 389 | $response = $fileUpload::getFiles($fileUpload::getRef(), $response->pluck('id')->toArray()); |
||||||||
| 390 | $this->assertTrue($response instanceof Collection); |
||||||||
| 391 | |||||||||
| 392 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 393 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 394 | $this->assertTrue($response instanceof Collection); |
||||||||
| 395 | $this->assertTrue($fileUpload::deleteAll($fileUpload::getRef())); |
||||||||
| 396 | $response = $fileUpload::getFiles($fileUpload::getRef(), $response->pluck('id')->toArray(), true); |
||||||||
| 397 | $this->assertTrue($response instanceof Collection); |
||||||||
| 398 | |||||||||
| 399 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 400 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 401 | $this->assertTrue($response instanceof Collection); |
||||||||
| 402 | $this->assertTrue($fileUpload::deleteAll($fileUpload::getRef())); |
||||||||
| 403 | $response = $fileUpload::getFiles($fileUpload::getRef(), $response[0]->id, true); |
||||||||
| 404 | $this->assertTrue($response instanceof FileUploadModel); |
||||||||
| 405 | |||||||||
| 406 | $fileUpload = new NoClamavFileUpload; |
||||||||
| 407 | $response = $fileUpload::uploadFiles($request, $settings); |
||||||||
| 408 | $this->assertTrue($response instanceof Collection); |
||||||||
| 409 | $this->assertTrue($fileUpload::deleteAll($fileUpload::getRef())); |
||||||||
| 410 | $response = $fileUpload::getFiles(null, null, true); |
||||||||
| 411 | $this->assertTrue($response instanceof Collection); |
||||||||
| 412 | } |
||||||||
| 413 | } |
||||||||
| 414 |