<?php

namespace Tests\Unit\Services\Settings;

use App\Services\Settings\ConfigurationService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class ConfigurationServiceTest extends TestCase
{
    use RefreshDatabase;

    public function test_store_creates_config(): void
    {
        $service = new ConfigurationService();
        $config = $service->store([
            'config_key' => 'school_year',
            'config_value' => '2025-2026',
        ]);

        $this->assertNotNull($config->id);
        $this->assertDatabaseHas('configuration', [
            'id' => $config->id,
            'config_key' => 'school_year',
        ]);
    }
}
