SettingServiceTest.php
1 <?php 2 3 namespace Tests\Services; 4 5 use App\Http\Services\SettingService; 6 use App\Models\Setting; 7 use Illuminate\Http\UploadedFile; 8 use Illuminate\Support\Facades\Storage; 9 use Livewire\TemporaryUploadedFile; 10 use Tests\TestCase; 11 12 class SettingServiceTest extends TestCase 13 { 14 15 public function testGetAll() 16 { 17 Setting::factory()->create(); 18 $this->assertInstanceOf(Setting::class, SettingService::getAll()); 19 } 20 21 public function testUpdateOrCreate() 22 { 23 $setting = Setting::factory()->create(); 24 $this->assertTrue(SettingService::updateOrCreate($this->exampleDataArray(), null, $setting->id)); 25 } 26 27 private function exampleDataArray(): array 28 { 29 return [ 30 'head' => '', 31 'email' => '', 32 'logo' => '', 33 'primary-color' => '', 34 'secondary-color' => '', 35 ]; 36 } 37 }