<?php

namespace Tests\Unit\Services\Support;

use App\Services\Email\EmailDispatchService;
use App\Services\Support\ContactMessageService;
use Tests\TestCase;

class ContactMessageServiceTest extends TestCase
{
    public function test_send_returns_payload(): void
    {
        $mailer = $this->createMock(EmailDispatchService::class);
        $mailer->method('send')->willReturn(false);

        $service = new ContactMessageService($mailer);
        $result = $service->send([
            'name' => 'Test User',
            'email' => 'test@example.com',
            'subject' => 'Hello',
            'message' => 'Message',
        ]);

        $this->assertArrayHasKey('email_sent', $result);
        $this->assertArrayHasKey('recipient', $result);
    }
}
