sendMessage() public method

Send message to a user.
public sendMessage ( array | string $userIds, string $text, integer | null $pinId = null ) : boolean
$userIds array | string
$text string
$pinId integer | null
return boolean
 public function testSendMessage()
 {
     $response = $this->createMessageSendResponse();
     $this->mock->expects($this->at(1))->method('exec')->willReturn($response);
     $this->mock->expects($this->at(3))->method('exec')->willReturn(null);
     $userId = '0000000000000';
     $message = 'test';
     $this->assertTrue($this->provider->sendMessage($userId, $message));
     $this->assertFalse($this->provider->sendMessage($userId, $message));
 }
Example #2
0
 /** @test */
 public function sendMessage()
 {
     $response = $this->createMessageSendResponse();
     $this->mock->shouldReceive('exec')->once()->andReturn($response);
     $this->mock->shouldReceive('exec')->once()->andReturnNull();
     $userId = '0000000000000';
     $message = 'test';
     $this->assertTrue($this->provider->sendMessage($userId, $message));
     $this->assertFalse($this->provider->sendMessage($userId, $message));
 }
 /**
  * @test
  * @expectedException \seregazhuk\PinterestBot\Exceptions\InvalidRequest
  */
 public function it_should_throw_exception_when_sending_message_to_no_users()
 {
     $this->provider->sendMessage([], '');
 }