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,35 @@
<?php
namespace Tests\Unit\Services\Settings;
use App\Models\Setting;
use App\Services\Settings\SettingsService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class SettingsServiceTest extends TestCase
{
use RefreshDatabase;
public function test_update_persists_settings(): void
{
$service = new SettingsService();
$result = $service->update([
'site_name' => 'Alrahma',
'timezone' => 'UTC',
'administrator_email' => 'admin@example.com',
], 1);
$this->assertSame('Alrahma', $result['site_name']);
$this->assertDatabaseHas('settings', [
'name' => 'Alrahma',
'timezone' => 'UTC',
]);
$this->assertDatabaseHas('configuration', [
'config_key' => 'administrator_email',
'config_value' => 'admin@example.com',
]);
}
}