diff --git a/core/Telegram/Message/Entity/Dice.php b/core/Telegram/Message/Entity/Dice.php new file mode 100644 index 0000000..c0290d5 --- /dev/null +++ b/core/Telegram/Message/Entity/Dice.php @@ -0,0 +1,20 @@ + 'string', + 'value' => 'int', + ])] array $data + ) + { + parent::__construct( + new Dice\Emoji($data['emoji']), + new Dice\Value($data['value']) + ); + } +} diff --git a/tests-core/Telegram/Message/Entity/DiceTest.php b/tests-core/Telegram/Message/Entity/DiceTest.php new file mode 100644 index 0000000..62d419d --- /dev/null +++ b/tests-core/Telegram/Message/Entity/DiceTest.php @@ -0,0 +1,31 @@ +assertEquals( + 'emoji', + $object->emoji->getValue() + ); + + $this->assertEquals( + 10, + $object->value->getValue() + ); + } +} diff --git a/tests-core/Telegram/Message/Proxy/Dice/AssociativeArrayTest.php b/tests-core/Telegram/Message/Proxy/Dice/AssociativeArrayTest.php new file mode 100644 index 0000000..e285565 --- /dev/null +++ b/tests-core/Telegram/Message/Proxy/Dice/AssociativeArrayTest.php @@ -0,0 +1,29 @@ + 'emoji', + 'value' => 10, + ]); + + $this->assertEquals( + 'emoji', + $object->emoji->getValue() + ); + + $this->assertEquals( + 10, + $object->value->getValue() + ); + } +}