mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-08-20 13:34:18 +00:00
32 lines
850 B
PHP
32 lines
850 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace BushlanovDev\MaxMessengerBot\Tests\Models\Attachments\Buttons;
|
|
|
|
use BushlanovDev\MaxMessengerBot\Enums\ButtonType;
|
|
use BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\LinkButton;
|
|
use PHPUnit\Framework\Attributes\CoversClass;
|
|
use PHPUnit\Framework\Attributes\Test;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
#[CoversClass(LinkButton::class)]
|
|
final class LinkButtonTest extends TestCase
|
|
{
|
|
#[Test]
|
|
public function toArraySerializesCorrectly(): void
|
|
{
|
|
$button = new LinkButton('Test Button', 'https://example.com');
|
|
|
|
$expectedArray = [
|
|
'url' => 'https://example.com',
|
|
'type' => ButtonType::Link->value,
|
|
'text' => 'Test Button',
|
|
];
|
|
|
|
$resultArray = $button->toArray();
|
|
|
|
$this->assertSame($expectedArray, $resultArray);
|
|
}
|
|
}
|