last() 공개 메소드

Get last user conversations.
public last ( ) : array | boolean
리턴 array | boolean
 public function testLast()
 {
     $lastConversations = array("1" => ["result"]);
     $res = $this->createApiResponse(array('data' => $lastConversations, 'error' => null));
     $this->mock->expects($this->at(1))->method('exec')->willReturn($res);
     $this->mock->expects($this->at(3))->method('exec')->willReturn(null);
     $this->assertEquals($lastConversations, $this->provider->last());
     $this->assertFalse($this->provider->last());
 }
예제 #2
0
 /** @test */
 public function getLastConversation()
 {
     $lastConversations = array("1" => ["result"]);
     $res = $this->createApiResponse(array('data' => $lastConversations, 'error' => null));
     $this->mock->shouldReceive('exec')->once()->andReturn($res);
     $this->mock->shouldReceive('exec')->once()->andReturnNull();
     $this->assertEquals($lastConversations, $this->provider->last());
     $this->assertFalse($this->provider->last());
 }
 /** @test */
 public function it_should_return_last_conversation()
 {
     $lastConversations = ['1' => ['result']];
     $this->apiShouldReturnData($lastConversations)->assertEquals($lastConversations, $this->provider->last());
     $this->apiShouldReturnEmpty()->assertFalse($this->provider->last());
 }