<?php

declare(strict_types=1);

namespace Ferienpass\AdminBundle\Tests\Components;

use Ferienpass\AdminBundle\Components\Notification;
use PHPUnit\Framework\TestCase;

final class NotificationTest extends TestCase
{
    public function testDefaultValues(): void
    {
        $notification = new Notification();

        self::assertSame('default', $notification->type);
        self::assertSame('', $notification->title);
        self::assertSame('', $notification->message);
        self::assertNull($notification->actionTitle);
        self::assertNull($notification->actionLink);
        self::assertNull($notification->primaryActionTitle);
        self::assertNull($notification->primaryActionLink);
        self::assertNull($notification->secondaryActionTitle);
        self::assertNull($notification->secondaryActionLink);
        self::assertTrue($notification->dismissible);
        self::assertSame(7, $notification->dismissAfter);
    }

    public function testGetObjectVarsReturnsAllProperties(): void
    {
        $notification = new Notification();
        $notification->type = 'success';
        $notification->title = 'Done';

        $vars = get_object_vars($notification);

        self::assertArrayHasKey('type', $vars);
        self::assertArrayHasKey('title', $vars);
        self::assertArrayHasKey('message', $vars);
        self::assertArrayHasKey('actionTitle', $vars);
        self::assertArrayHasKey('dismissible', $vars);
        self::assertArrayHasKey('dismissAfter', $vars);
        self::assertSame('success', $vars['type']);
        self::assertSame('Done', $vars['title']);
    }
}
