3
3
namespace TelegramBot \Api \Test ;
4
4
5
5
use TelegramBot \Api \Types \Chat ;
6
+ use TelegramBot \Api \Types \Dice ;
6
7
use TelegramBot \Api \Types \Document ;
7
8
use TelegramBot \Api \Types \Location ;
8
9
use TelegramBot \Api \Types \Audio ;
@@ -304,6 +305,7 @@ public function testSetVoice()
304
305
$ item = new Message ();
305
306
$ voice = Voice::fromResponse (array (
306
307
'file_id ' => 'testFileId1 ' ,
308
+ 'file_unique_id ' => 'testUniqueFileId ' ,
307
309
'duration ' => 1 ,
308
310
'mime_type ' => 'audio/mp3 ' ,
309
311
'file_size ' => 3
@@ -317,6 +319,7 @@ public function testGetVoice()
317
319
$ item = new Message ();
318
320
$ voice = Voice::fromResponse (array (
319
321
'file_id ' => 'testFileId1 ' ,
322
+ 'file_unique_id ' => 'testUniqueFileId ' ,
320
323
'duration ' => 1 ,
321
324
'mime_type ' => 'audio/mp3 ' ,
322
325
'file_size ' => 3
@@ -369,6 +372,29 @@ public function testGetVideo()
369
372
$ this ->assertInstanceOf ('\TelegramBot\Api\Types\Video ' , $ item ->getVideo ());
370
373
}
371
374
375
+ public function testSetDice ()
376
+ {
377
+ $ item = new Message ();
378
+ $ dice = Dice::fromResponse (array (
379
+ 'emoji ' => '🎲 ' ,
380
+ 'value ' => 3
381
+ ));
382
+ $ item ->setDice ($ dice );
383
+ $ this ->assertAttributeEquals ($ dice , 'dice ' , $ item );
384
+ }
385
+
386
+ public function testGetDice ()
387
+ {
388
+ $ item = new Message ();
389
+ $ dice = Dice::fromResponse (array (
390
+ 'emoji ' => '🎲 ' ,
391
+ 'value ' => 3
392
+ ));
393
+ $ item ->setDice ($ dice );
394
+ $ this ->assertEquals ($ dice , $ item ->getDice ());
395
+ $ this ->assertInstanceOf ('\TelegramBot\Api\Types\Dice ' , $ item ->getDice ());
396
+ }
397
+
372
398
public function testSetSticker ()
373
399
{
374
400
$ item = new Message ();
0 commit comments