Skip to content

Fixing the search endpoint #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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