Skip to content

Commit

Permalink
Fixing the search endpoint
Browse files Browse the repository at this point in the history
* By removing the leading "/", the base path can now be appended.
  * The path being used was /search and not /api/v3/search
  • Loading branch information
James Solomon committed Apr 7, 2015
1 parent d561376 commit 5e610d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions lib/Github/Api/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Search extends AbstractApi
*/
public function repositories($q, $sort = 'updated', $order = 'desc')
{
return $this->get('/search/repositories', array('q' => $q, 'sort' => $sort, 'order' => $order));
return $this->get('search/repositories', array('q' => $q, 'sort' => $sort, 'order' => $order));
}

/**
Expand All @@ -46,7 +46,7 @@ public function repositories($q, $sort = 'updated', $order = 'desc')
*/
public function issues($q, $sort = 'updated', $order = 'desc')
{
return $this->get('/search/issues', array('q' => $q, 'sort' => $sort, 'order' => $order));
return $this->get('search/issues', array('q' => $q, 'sort' => $sort, 'order' => $order));
}

/**
Expand All @@ -62,7 +62,7 @@ public function issues($q, $sort = 'updated', $order = 'desc')
*/
public function code($q, $sort = 'updated', $order = 'desc')
{
return $this->get('/search/code', array('q' => $q, 'sort' => $sort, 'order' => $order));
return $this->get('search/code', array('q' => $q, 'sort' => $sort, 'order' => $order));
}

/**
Expand All @@ -78,6 +78,6 @@ public function code($q, $sort = 'updated', $order = 'desc')
*/
public function users($q, $sort = 'updated', $order = 'desc')
{
return $this->get('/search/users', array('q' => $q, 'sort' => $sort, 'order' => $order));
return $this->get('search/users', array('q' => $q, 'sort' => $sort, 'order' => $order));
}
}
16 changes: 8 additions & 8 deletions test/Github/Tests/Api/SearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function shouldSearchRepositoriesByQuery()
$api->expects($this->once())
->method('get')
->with(
'/search/repositories',
'search/repositories',
array('q' => 'query text', 'sort' => 'updated', 'order' => 'desc')
)
->will($this->returnValue($expectedArray));
Expand All @@ -36,7 +36,7 @@ public function shouldSearchRepositoriesRegardingSortAndOrder()
$api->expects($this->once())
->method('get')
->with(
'/search/repositories',
'search/repositories',
array('q' => 'query text', 'sort' => 'created', 'order' => 'asc')
)
->will($this->returnValue($expectedArray));
Expand All @@ -59,7 +59,7 @@ public function shouldSearchIssuesByQuery()
$api->expects($this->once())
->method('get')
->with(
'/search/issues',
'search/issues',
array('q' => 'query text', 'sort' => 'updated', 'order' => 'desc')
)
->will($this->returnValue($expectedArray));
Expand All @@ -79,7 +79,7 @@ public function shouldSearchIssuesRegardingSortAndOrder()
$api->expects($this->once())
->method('get')
->with(
'/search/issues',
'search/issues',
array('q' => 'query text', 'sort' => 'created', 'order' => 'asc')
)
->will($this->returnValue($expectedArray));
Expand All @@ -102,7 +102,7 @@ public function shouldSearchCodeByQuery()
$api->expects($this->once())
->method('get')
->with(
'/search/code',
'search/code',
array('q' => 'query text', 'sort' => 'updated', 'order' => 'desc')
)
->will($this->returnValue($expectedArray));
Expand All @@ -122,7 +122,7 @@ public function shouldSearchCodeRegardingSortAndOrder()
$api->expects($this->once())
->method('get')
->with(
'/search/code',
'search/code',
array('q' => 'query text', 'sort' => 'created', 'order' => 'asc')
)
->will($this->returnValue($expectedArray));
Expand All @@ -145,7 +145,7 @@ public function shouldSearchUsersByQuery()
$api->expects($this->once())
->method('get')
->with(
'/search/users',
'search/users',
array('q' => 'query text', 'sort' => 'updated', 'order' => 'desc')
)
->will($this->returnValue($expectedArray));
Expand All @@ -165,7 +165,7 @@ public function shouldSearchUsersRegardingSortAndOrder()
$api->expects($this->once())
->method('get')
->with(
'/search/users',
'search/users',
array('q' => 'query text', 'sort' => 'created', 'order' => 'asc')
)
->will($this->returnValue($expectedArray));
Expand Down

0 comments on commit 5e610d0

Please sign in to comment.