Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 72a35f9

Browse files
committed
New tests
1 parent 9262ba0 commit 72a35f9

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"update_id":758442029,"callback_query":{"id":"47054498280709335","from":{"id":10955729,"first_name":"Camilo","last_name":"Sperberg","username":"unreal4u"},"message":{"message_id":57,"from":{"id":155349290,"first_name":"uptimeMonitorBot","username":"uptimeMonitorBot"},"chat":{"id":10955729,"first_name":"Camilo","last_name":"Sperberg","username":"unreal4u","type":"private"},"date":1480374178,"reply_to_message":{"message_id":56,"from":{"id":10955729,"first_name":"Camilo","last_name":"Sperberg","username":"unreal4u"},"chat":{"id":10955729,"first_name":"Camilo","last_name":"Sperberg","username":"unreal4u","type":"private"},"date":1480374178,"text":"/setup","entities":[{"type":"bot_command","offset":0,"length":6}]},"text":"Welcome! Let's get you up and running. Open up this url and create a free account\n\nHave you created the account?","entities":[{"type":"text_link","offset":39,"length":16,"url":"https://uptimerobot.com/"}]},"chat_instance":"-5438169858624920681","data":"setup-S2"}}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
namespace unreal4u\TelegramAPI\tests\Telegram\Types;
4+
5+
use PHPUnit_Framework_TestCase as TestCase;
6+
#use PHPUnit\Framework\TestCase;
7+
use unreal4u\TelegramAPI\Telegram\Types\CallbackQuery;
8+
use unreal4u\TelegramAPI\Telegram\Types\Update;
9+
use unreal4u\TelegramAPI\tests\Mock\MockTgLog;
10+
11+
class InlineKeyboardMarkupTest extends TestCase
12+
{
13+
/**
14+
* @var MockTgLog
15+
*/
16+
private $tgLog;
17+
18+
/**
19+
* Prepares the environment before running a test.
20+
*/
21+
protected function setUp()
22+
{
23+
parent::setUp();
24+
$this->tgLog = new MockTgLog('TEST-TEST');
25+
}
26+
27+
/**
28+
* Cleans up the environment after running a test.
29+
*/
30+
protected function tearDown()
31+
{
32+
$this->tgLog = null;
33+
parent::tearDown();
34+
}
35+
36+
public function testIncomingUpdate()
37+
{
38+
$postData = $this->tgLog->getTestTypeResponse('InlineKeyboardMarkup');
39+
$update = new Update($postData);
40+
41+
$this->assertInstanceOf(CallbackQuery::class, $update->callback_query);
42+
#var_dump($update);
43+
}
44+
}

0 commit comments

Comments
 (0)