add all controllers logic

This commit is contained in:
root
2026-03-11 17:53:15 -04:00
parent 3e6c577085
commit 2ef71cc92b
421 changed files with 12009 additions and 5211 deletions
@@ -0,0 +1,30 @@
<?php
namespace Tests\Unit\Services\Preferences;
use App\Services\Preferences\PreferencesCommandService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class PreferencesCommandServiceTest extends TestCase
{
use RefreshDatabase;
public function test_upsert_creates_record(): void
{
$service = app(PreferencesCommandService::class);
$pref = $service->upsert(1, [
'receive_email_notifications' => true,
'receive_sms_notifications' => false,
'theme' => 'light',
'language' => 'en',
]);
$this->assertSame(1, $pref->user_id);
$this->assertDatabaseHas('user_preferences', [
'user_id' => 1,
'notification_email' => 1,
'notification_sms' => 0,
]);
}
}