mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-10-08 21:08:52 +00:00
Added ChatButton & ReplyButtons
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user