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()); }
/** @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()); }