<?php

namespace Tests\Unit;

use App\Models\Tenant;
use App\Services\PlatformSettings;
use Tests\TestCase;

class TenantSenderOverrideTest extends TestCase
{
    public function test_tenant_sender_overrides_apply_while_using_platform_gateways(): void
    {
        $tenant = new Tenant([
            'name' => 'Demo Tenant',
            'settings' => [
                'sms_use_platform_defaults' => true,
                'sms_from' => 'DEMOSMS',
                'whatsapp_use_platform_defaults' => true,
                'whatsapp_from' => 'Demo WhatsApp',
            ],
        ]);

        $settings = app(PlatformSettings::class);

        $this->assertSame('DEMOSMS', $settings->smsSettings($tenant)['sender']);
        $this->assertSame('Demo WhatsApp', $settings->whatsappSettings($tenant)['sender']);
    }
}
