Skip to content

Commit

Permalink
fix: change reflection class, to reflection method
Browse files Browse the repository at this point in the history
  • Loading branch information
CamKem committed Nov 18, 2024
1 parent 6a3544c commit 27d2793
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions tests/Unit/Livewire/Questions/CreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,7 @@

$component->set('images', [$file]);

$reflection = new ReflectionClass(Create::class);
$method = $reflection->getMethod('uploadImages');
$method = new ReflectionMethod(Create::class, 'uploadImages');
$method->setAccessible(true);
$method->invoke($component->instance());

Expand All @@ -436,8 +435,7 @@
]);
$component->set('images', [$file]);

$reflection = new ReflectionClass(Create::class);
$method = $reflection->getMethod('uploadImages');
$method = new ReflectionMethod(Create::class, 'uploadImages');
$method->setAccessible(true);
$method->invoke($component->instance());

Expand Down Expand Up @@ -492,8 +490,7 @@

Storage::disk('public')->assertExists($path);

$reflection = new ReflectionClass(Create::class);
$method = $reflection->getMethod('deleteImage');
$method = new ReflectionMethod(Create::class, 'deleteImage');
$method->setAccessible(true);
$method->invoke($component->instance(), $path);

Expand Down Expand Up @@ -610,8 +607,7 @@

$component->set('images', [UploadedFile::fake()->image('test.jpg')]);

$reflection = new ReflectionClass(Create::class);
$method = $reflection->getMethod('uploadImages');
$method = new ReflectionMethod(Create::class, 'uploadImages');
$method->setAccessible(true);
$method->invoke($component->instance());

Expand All @@ -629,8 +625,7 @@

$component->set('images', [UploadedFile::fake()->image('test.jpg')]);

$reflection = new ReflectionClass(Create::class);
$method = $reflection->getMethod('uploadImages');
$method = new ReflectionMethod(Create::class, 'uploadImages');
$method->setAccessible(true);
$method->invoke($component->instance());

Expand Down

0 comments on commit 27d2793

Please sign in to comment.