/** @test */
 function it_creates_the_data_for_the_post_request()
 {
     $method = $this->getProtectedMethod(Messenger::class, 'createDataForRequest');
     $messageData = $this->message->buildMessage();
     $result = $method->invokeArgs($this->messenger, [$messageData, $this->recipient]);
     $this->assertEquals(['form_params' => ['recipient' => ['id' => 123456789], 'message' => ['text' => 'Some title']]], $result);
 }
Example #2
0
 public function send(Message $message, $recipient)
 {
     $data = $this->createDataForRequest($message->buildMessage(), $recipient);
     return $this->doRequest($data);
 }