Skip to content

Commit

Permalink
Adding fix for location queries
Browse files Browse the repository at this point in the history
  • Loading branch information
karllhughes committed Jul 25, 2015
1 parent f9d6bb1 commit cc4b890
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ All Notable changes to `jobs-govt` will be documented in this file
- Nothing

### Fixed
- Nothing
- Added " in " to search string when looking for locations to correct erroneous results

### Removed
- Nothing
Expand Down
2 changes: 1 addition & 1 deletion src/Govt.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function getListingsPath()
*/
public function getKeyword()
{
$keyword = ($this->keyword ? $this->keyword.' ' : null).($this->getLocation() ?: null);
$keyword = ($this->keyword ? $this->keyword : null).($this->getLocation() ? ' in '.$this->getLocation() : null);

if ($keyword) {
return $keyword;
Expand Down
6 changes: 3 additions & 3 deletions tests/src/GovtTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testUrlIncludesKeywordWhenCityAndStateProvided()
{
$city = uniqid();
$state = uniqid();
$param = 'query='.urlencode($city.', '.$state);
$param = 'query='.urlencode(' in '.$city.', '.$state);

$url = $this->client->setCity($city)->setState($state)->getUrl();

Expand All @@ -68,7 +68,7 @@ public function testUrlIncludesKeywordWhenCityAndStateProvided()
public function testUrlIncludesKeywordWhenCityProvided()
{
$city = uniqid();
$param = 'query='.urlencode($city);
$param = 'query='.urlencode(' in '.$city);

$url = $this->client->setCity($city)->getUrl();

Expand All @@ -78,7 +78,7 @@ public function testUrlIncludesKeywordWhenCityProvided()
public function testUrlIncludesKeywordWhenStateProvided()
{
$state = uniqid();
$param = 'query='.urlencode($state);
$param = 'query='.urlencode(' in '.$state);

$url = $this->client->setState($state)->getUrl();

Expand Down

0 comments on commit cc4b890

Please sign in to comment.