This repository has been archived by the owner on Apr 21, 2024. It is now read-only.
forked from irazasyed/telegram-bot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix one-to-many relations (irazasyed#964)
- Loading branch information
Showing
10 changed files
with
76 additions
and
17 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
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
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,31 @@ | ||
<?php | ||
|
||
namespace Telegram\Bot\Tests\Unit\Objects; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Telegram\Bot\Objects\Message; | ||
use Telegram\Bot\Objects\PhotoSize; | ||
|
||
/** @covers \Telegram\Bot\Objects\Message */ | ||
class MessageTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_inits_one_to_many_relation(): void | ||
{ | ||
$message = Message::make([ | ||
'photo' => [ | ||
['file_id' => ''], | ||
['file_id' => ''], | ||
['file_id' => ''], | ||
['file_id' => ''], | ||
], | ||
]); | ||
|
||
$this->assertIsIterable($message->photo); | ||
$this->assertCount(4, $message->photo); | ||
$this->assertInstanceOf(PhotoSize::class, $message->photo[0]); | ||
$this->assertInstanceOf(PhotoSize::class, $message->photo[1]); | ||
$this->assertInstanceOf(PhotoSize::class, $message->photo[2]); | ||
$this->assertInstanceOf(PhotoSize::class, $message->photo[3]); | ||
} | ||
} |