public function testGetBody_WithArray_ReturnsArray() { $this->request->method('getQueryParams')->willReturn([]); $this->request->method('getParsedBody')->willReturn(['title' => 'value']); $apiRequest = new ApiRequest($this->request); $this->assertEquals(['title' => 'value'], $apiRequest->getBody()); }
/** * Get the data. */ public function executeItemQuery($query, ApiRequest $apiRequest) { $itemQuery = $query; $repository = $this->orm->getRepositoryFromQuery($itemQuery); $this->addFilterCriteria($itemQuery, $repository, $apiRequest->getFilters()); $results = $this->orm->executeQuery($itemQuery); return $results; }