Added BotRemovedFromChatUpdate & ChatTitleChangedUpdate & MessageChatCreatedUpdate & UserAddedToChatUpdate & UserRemovedFromChatUpdate

This commit is contained in:
Alex
2025-07-25 08:34:38 +03:00
parent d5b950bcd9
commit 06492a698f
16 changed files with 1013 additions and 42 deletions
+21
View File
@@ -204,4 +204,25 @@ final class WebhookHandlerTest extends TestCase
$this->assertSame($expectedUpdate, $result);
}
#[Test]
public function getUpdateParsesRequestAndReturnsUpdateObject(): void
{
$payload = $this->createValidUpdatePayload();
$updateData = json_decode($payload, true);
$expectedUpdate = $this->createRealUpdateObject($updateData);
$request = new ServerRequest('POST', '/webhook', [], $payload);
$this->modelFactoryMock
->expects($this->once())
->method('createUpdate')
->with($updateData)
->willReturn($expectedUpdate);
$webhookHandler = new WebhookHandler($this->apiMock, $this->modelFactoryMock);
$result = $webhookHandler->getUpdate($request);
$this->assertSame($expectedUpdate, $result);
}
}