diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d7c9cd..804faa0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - tools: composer:v1 + tools: composer:v2 - name: Composer cache uses: actions/cache@v4 with: diff --git a/src/Bot/Model/Request/MessageSendRequest.php b/src/Bot/Model/Request/MessageSendRequest.php index 26c6bdc..0a07f8f 100644 --- a/src/Bot/Model/Request/MessageSendRequest.php +++ b/src/Bot/Model/Request/MessageSendRequest.php @@ -101,6 +101,15 @@ class MessageSendRequest implements ModelInterface */ private $transportAttachments; + /** + * @var bool $massCommunication + * + * @Type("bool") + * @Accessor(getter="getMassCommunication",setter="setMassCommunication") + * @Serializer\SerializedName("mass_communication") + */ + private $massCommunication; + /** * @var int $chatId * @@ -170,6 +179,22 @@ public function setTransportAttachments(TransportAttachments $transportAttachmen $this->transportAttachments = $transportAttachments; } + /** + * @return bool|null + */ + public function getMassCommunication(): ?bool + { + return $this->massCommunication; + } + + /** + * @param bool|null $massCommunication + */ + public function setMassCommunication(?bool $massCommunication): void + { + $this->massCommunication = $massCommunication; + } + /** * @return string */ diff --git a/tests/Bot/Tests/Model/MessageSendRequestTest.php b/tests/Bot/Tests/Model/MessageSendRequestTest.php new file mode 100644 index 0000000..565b321 --- /dev/null +++ b/tests/Bot/Tests/Model/MessageSendRequestTest.php @@ -0,0 +1,32 @@ +setMassCommunication($value); + + $result = Serializer::serialize($request, Serializer::S_ARRAY); + + self::assertEquals(['mass_communication' => $value], $result); + } + + public function dataProvider_massCommunication(): array + { + return [ + [true], + [false], + ]; + } +} \ No newline at end of file