mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-08-19 14:27:01 +00:00
34 lines
998 B
PHP
34 lines
998 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace BushlanovDev\MaxMessengerBot\Tests\Models\Attachments\Buttons\Inline;
|
|
|
|
use BushlanovDev\MaxMessengerBot\Enums\InlineButtonType;
|
|
use BushlanovDev\MaxMessengerBot\Enums\Intent;
|
|
use BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Inline\CallbackButton;
|
|
use PHPUnit\Framework\Attributes\CoversClass;
|
|
use PHPUnit\Framework\Attributes\Test;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
#[CoversClass(CallbackButton::class)]
|
|
final class CallbackButtonTest extends TestCase
|
|
{
|
|
#[Test]
|
|
public function toArraySerializesCorrectly(): void
|
|
{
|
|
$button = new CallbackButton('Test Button', 'test_payload', Intent::Default);
|
|
|
|
$expectedArray = [
|
|
'payload' => 'test_payload',
|
|
'intent' => Intent::Default->value,
|
|
'type' => InlineButtonType::Callback->value,
|
|
'text' => 'Test Button',
|
|
];
|
|
|
|
$resultArray = $button->toArray();
|
|
|
|
$this->assertSame($expectedArray, $resultArray);
|
|
}
|
|
}
|