コード例 #1
0
 public function testArrayRepresentationOfSolrQueryIsMemoized()
 {
     $this->stubCriteria->expects($this->once())->method('jsonSerialize')->willReturn(['fieldName' => 'foo', 'fieldValue' => 'bar', 'operation' => 'Equal']);
     $stubContext = $this->createMock(Context::class);
     $stubContext->method('getSupportedCodes')->willReturn([]);
     $this->stubQueryOptions->method('getContext')->willReturn($stubContext);
     $stubSortOrderConfig = $this->createMock(SortBy::class);
     $this->stubQueryOptions->method('getSortBy')->willReturn($stubSortOrderConfig);
     $resultA = $this->solrQuery->toArray();
     $resultB = $this->solrQuery->toArray();
     $this->assertSame($resultA, $resultB);
 }
コード例 #2
0
 private function querySolr(SolrQuery $query, SolrFacetFilterRequest $facetFilterRequest) : SolrResponse
 {
     $queryParameters = $query->toArray();
     $facetParameters = $facetFilterRequest->toArray();
     $response = $this->client->select(array_merge($queryParameters, $facetParameters));
     return SolrResponse::fromSolrResponseArray($response, $this->facetFieldTransformationRegistry);
 }