/** @test */ public function getLatest() { $news = ['data' => 'news']; $response = $this->createApiResponse($news); $error = $this->createErrorApiResponse(); $this->mock->shouldReceive('exec')->once()->andReturn($response); $this->mock->shouldReceive('exec')->once()->andReturn($error); $this->assertEquals('news', $this->provider->latest()); $this->assertFalse($this->provider->latest()); }
/** @test */ public function it_returns_all_news() { $this->apiShouldReturnPagination()->apiShouldReturnEmpty(); $news = $this->provider->all(); $this->assertIsPaginatedResponse($news); }