assertInstanceOf( WhatsAppInteractiveMessage::class, $message ); // test that it still compatible with a \CMText\Message $CMTextMessage = new Message(); $CMTextMessage ->WithChannels([Channels::WHATSAPP]) ->WithRichMessage($message); // echo json_encode($CMTextMessage); $this->assertInstanceOf( Message::class, $CMTextMessage ); } /** * @throws \CMText\Exceptions\RecipientLimitException * @throws \CMText\Exceptions\ConversationLimitException */ public function testWhatsAppInteractiveButtonsMessage() { // test building a WhatsApp Interactive Message with Buttons $message = new WhatsAppInteractiveMessage( new WhatsAppInteractiveContent( WhatsAppInteractiveContentTypes::BUTTON, new WhatsAppInteractiveHeader( WhatsAppInteractiveHeaderTypes::IMAGE, null, new MediaContent( 'media name', 'media.url', 'mime/type' ) ), new WhatsAppInteractiveBody('checkout our list message demo'), new WhatsAppInteractiveButtonAction( [new WhatsAppInteractiveReplyButton( 'button 1 reply-text', rand() ),new WhatsAppInteractiveReplyButton( 'button 2 title', rand() )] ), new WhatsAppInteractiveFooter('footer text') ) ); $this->assertInstanceOf( WhatsAppInteractiveMessage::class, $message ); } }