-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace unreal4u\TelegramAPI\tests\Telegram\Types; | ||
|
||
use PHPUnit_Framework_TestCase as TestCase; | ||
#use PHPUnit\Framework\TestCase; | ||
use unreal4u\TelegramAPI\Telegram\Types\CallbackQuery; | ||
use unreal4u\TelegramAPI\Telegram\Types\Update; | ||
use unreal4u\TelegramAPI\tests\Mock\MockTgLog; | ||
|
||
class InlineKeyboardMarkupTest extends TestCase | ||
{ | ||
/** | ||
* @var MockTgLog | ||
*/ | ||
private $tgLog; | ||
|
||
/** | ||
* Prepares the environment before running a test. | ||
*/ | ||
protected function setUp() | ||
{ | ||
parent::setUp(); | ||
$this->tgLog = new MockTgLog('TEST-TEST'); | ||
} | ||
|
||
/** | ||
* Cleans up the environment after running a test. | ||
*/ | ||
protected function tearDown() | ||
{ | ||
$this->tgLog = null; | ||
parent::tearDown(); | ||
} | ||
|
||
public function testIncomingUpdate() | ||
{ | ||
$postData = $this->tgLog->getTestTypeResponse('InlineKeyboardMarkup'); | ||
$update = new Update($postData); | ||
|
||
$this->assertInstanceOf(CallbackQuery::class, $update->callback_query); | ||
#var_dump($update); | ||
} | ||
} |