mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-10-08 04:47:44 +00:00
Add disableLinkPreview to answerOnCallback
POST /answers got the disable_link_preview query parameter in August 2026. It is sent only when true, so default requests are unchanged.
This commit is contained in:
@@ -1915,6 +1915,31 @@ final class ApiTest extends TestCase
|
||||
$this->assertSame($expectedResult, $result);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function answerOnCallbackCanDisableLinkPreview(): void
|
||||
{
|
||||
$expectedResult = new Result(true, null);
|
||||
|
||||
$this->clientMock
|
||||
->expects($this->once())
|
||||
->method('request')
|
||||
->with(
|
||||
'POST',
|
||||
'/answers',
|
||||
['callback_id' => 'cb.123.abc', 'disable_link_preview' => true],
|
||||
['message' => ['text' => 'See https://dev.max.ru', 'notify' => true]],
|
||||
)
|
||||
->willReturn(['success' => true]);
|
||||
|
||||
$this->modelFactoryMock
|
||||
->expects($this->once())
|
||||
->method('createResult')
|
||||
->willReturn($expectedResult);
|
||||
|
||||
$result = $this->api->answerOnCallback('cb.123.abc', text: 'See https://dev.max.ru', disableLinkPreview: true);
|
||||
$this->assertSame($expectedResult, $result);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function answerOnCallbackWithMessageEdit(): void
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user