From 27d2793ba650b68d84a54806005ccaba2bf83762 Mon Sep 17 00:00:00 2001 From: Cam Kemshal-Bell Date: Tue, 19 Nov 2024 08:06:19 +1100 Subject: [PATCH] fix: change reflection class, to reflection method --- tests/Unit/Livewire/Questions/CreateTest.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/Unit/Livewire/Questions/CreateTest.php b/tests/Unit/Livewire/Questions/CreateTest.php index 135ed4342..4594f9f51 100644 --- a/tests/Unit/Livewire/Questions/CreateTest.php +++ b/tests/Unit/Livewire/Questions/CreateTest.php @@ -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()); @@ -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()); @@ -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); @@ -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()); @@ -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());