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)); }
/** @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([], ''); }