Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Commit

Permalink
Merge 23cb074 into d32e9ba
Browse files Browse the repository at this point in the history
  • Loading branch information
bertramakers committed May 18, 2017
2 parents d32e9ba + 23cb074 commit 1fc5e90
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"require": {
"cultuurnet/hydra": "~0.1",
"cultuurnet/udb3-search": "~0.1",
"cultuurnet/udb3-search": "dev-feature/III-2072 as 0.1",
"cultuurnet/geocoding": "~0.1",
"cultuurnet/valueobjects": "~3.0",
"symfony/http-foundation": "~2.7.2"
Expand Down
6 changes: 6 additions & 0 deletions src/OfferSearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ public function search(Request $request)
);
}

if (!empty($request->query->get('text'))) {
$parameters = $parameters->withText(
new StringLiteral($request->query->get('text'))
);
}

$textLanguages = $this->getLanguagesFromQuery($request, 'textLanguages');
if (!empty($textLanguages)) {
$parameters = $parameters->withTextLanguages(...$textLanguages);
Expand Down
9 changes: 6 additions & 3 deletions tests/OfferSearchControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use CultuurNet\Geocoding\Coordinate\Coordinates;
use CultuurNet\Geocoding\Coordinate\Latitude;
use CultuurNet\Geocoding\Coordinate\Longitude;
use CultuurNet\Hydra\PagedCollection;
use CultuurNet\UDB3\Address\PostalCode;
use CultuurNet\UDB3\Label\ValueObjects\LabelName;
use CultuurNet\UDB3\Language;
Expand Down Expand Up @@ -106,7 +105,8 @@ public function it_returns_a_paged_collection_of_search_results_based_on_request
[
'start' => 30,
'limit' => 10,
'q' => 'dag van de fiets',
'q' => 'dag van de fiets AND labels:foo',
'text' => '(foo OR bar) AND baz',
'id' => '42926044-09f4-4bd5-bc35-427b2fc1a525',
'locationId' => '652ab95e-fdff-41ce-8894-1b29dce0d230',
'organizerId' => '392168d7-57c9-4488-8e2e-d492c843054b',
Expand Down Expand Up @@ -155,7 +155,10 @@ public function it_returns_a_paged_collection_of_search_results_based_on_request

$expectedSearchParameters = (new OfferSearchParameters())
->withQueryString(
new MockQueryString('dag van de fiets')
new MockQueryString('dag van de fiets AND labels:foo')
)
->withText(
new StringLiteral('(foo OR bar) AND baz')
)
->withCdbid(
new Cdbid('42926044-09f4-4bd5-bc35-427b2fc1a525')
Expand Down

0 comments on commit 1fc5e90

Please sign in to comment.