/** @test */ public function it_should_return_data_and_bookmarks_from_response_with_pagination() { $dataWithBookmarks = ['resource' => ['options' => ['bookmarks' => ['my_bookmarks_string']]], 'resource_response' => ['data' => 'some data']]; $response = new Response(); $response->fill($dataWithBookmarks); $expected = ['data' => 'some data', 'bookmarks' => ['my_bookmarks_string']]; $this->assertEquals($expected, $response->getPaginationData()); }
/** * @return array */ public function getLastError() { return $this->response->getLastError(); }
/** * @return array */ public function getResponseData() { $results = $this->response->getData('module.tree.data.results', []); return $results ?: $this->response->getResponseData(); }
/** * Simply proxies call to Response object. * * @return array|null */ public function getClientInfo() { return $this->response->getClientInfo(); }
/** @test */ public function it_should_proxy_client_info_to_response() { $clientInfo = ['info']; $this->response->shouldReceive('getClientInfo')->andReturn($clientInfo); $this->assertEquals($clientInfo, $this->container->getClientInfo()); }
/** * @param string $res * @return Response */ protected function processResult($res) { return $this->response->fill(json_decode($res, true)); }