-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Integration with Business Accounts
- Loading branch information
1 parent
36085b2
commit 1189fd4
Showing
6 changed files
with
247 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
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
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
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,61 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace TelegramBot\Api\Test\Types; | ||
|
||
use TelegramBot\Api\Test\AbstractTypeTest; | ||
use TelegramBot\Api\Types\BusinessConnection; | ||
|
||
class BusinessConnectionTest extends AbstractTypeTest | ||
{ | ||
|
||
protected static function getType() | ||
{ | ||
return BusinessConnection::class; | ||
} | ||
|
||
public static function getMinResponse() | ||
{ | ||
return [ | ||
'id' => 1, | ||
'user' => UserTest::getMinResponse(), | ||
'user_chat_id' => 1, | ||
'date' => 1682343643, | ||
'can_reply' => true, | ||
'is_enabled' => true | ||
]; | ||
} | ||
|
||
public static function getFullResponse() | ||
{ | ||
return [ | ||
'id' => 1, | ||
'user' => UserTest::getMinResponse(), | ||
'user_chat_id' => 1, | ||
'date' => 1682343643, | ||
'can_reply' => true, | ||
'is_enabled' => true | ||
]; | ||
} | ||
|
||
protected function assertMinItem($item) | ||
{ | ||
$this->assertEquals(1, $item->getId()); | ||
$this->assertEquals(UserTest::createMinInstance(), $item->getUser()); | ||
$this->assertEquals(1, $item->getUserChatId()); | ||
$this->assertEquals(1682343643, $item->getDate()); | ||
$this->assertTrue($item->getCanReply()); | ||
$this->assertTrue($item->getIsEnabled()); | ||
} | ||
|
||
protected function assertFullItem($item) | ||
{ | ||
$this->assertEquals(1, $item->getId()); | ||
$this->assertEquals(UserTest::createMinInstance(), $item->getUser()); | ||
$this->assertEquals(1, $item->getUserChatId()); | ||
$this->assertEquals(1682343643, $item->getDate()); | ||
$this->assertTrue($item->getCanReply()); | ||
$this->assertTrue($item->getIsEnabled()); | ||
} | ||
} |
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,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace TelegramBot\Api\Test\Types; | ||
|
||
use TelegramBot\Api\Test\AbstractTypeTest; | ||
use TelegramBot\Api\Types\BusinessMessagesDeleted; | ||
|
||
class BusinessMessagesDeletedTest extends AbstractTypeTest | ||
{ | ||
protected static function getType() | ||
{ | ||
return BusinessMessagesDeleted::class; | ||
} | ||
|
||
public static function getMinResponse() | ||
{ | ||
return [ | ||
'business_connection_id' => 'id', | ||
'chat' => ChatTest::getMinResponse(), | ||
'message_ids' => [1, 2, 3], | ||
]; | ||
} | ||
|
||
public static function getFullResponse() | ||
{ | ||
return [ | ||
'business_connection_id' => 'id', | ||
'chat' => ChatTest::getMinResponse(), | ||
'message_ids' => [1, 2, 3], | ||
]; | ||
} | ||
|
||
protected function assertMinItem($item) | ||
{ | ||
$this->assertEquals('id', $item->getBusinessConnectionId()); | ||
$this->assertEquals(ChatTest::createMinInstance(), $item->getChat()); | ||
$this->assertEquals([1, 2, 3], $item->getMessageIds()); | ||
} | ||
|
||
protected function assertFullItem($item) | ||
{ | ||
$this->assertEquals('id', $item->getBusinessConnectionId()); | ||
$this->assertEquals(ChatTest::createMinInstance(), $item->getChat()); | ||
$this->assertEquals([1, 2, 3], $item->getMessageIds()); | ||
} | ||
} |
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