<?php

namespace App\Tests\Message;

use App\Message\AnalyticsMessage;
use PHPUnit\Framework\TestCase;

class AnalyticsMessageTest extends TestCase
{
    public function testMessageCreation(): void
    {
        $payload = ['foo' => 'bar'];
        $message = new AnalyticsMessage('uid-123', 'test_action', $payload);

        $this->assertSame('uid-123', $message->uid);
        $this->assertSame('test_action', $message->action);
        $this->assertSame($payload, $message->payload);
    }

    public function testMessageDefaultPayload(): void
    {
        $message = new AnalyticsMessage('uid-123', 'test_action');
        $this->assertSame([], $message->payload);
    }
}
