Skip to content

Commit d2729cf

Browse files
committed
Merge pull request KnpLabs#260 from solomonjames/solomonjames/fixsearch
Fixing the search endpoint
2 parents 27b00fc + 5e610d0 commit d2729cf

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

lib/Github/Api/Search.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Search extends AbstractApi
3030
*/
3131
public function repositories($q, $sort = 'updated', $order = 'desc')
3232
{
33-
return $this->get('/search/repositories', array('q' => $q, 'sort' => $sort, 'order' => $order));
33+
return $this->get('search/repositories', array('q' => $q, 'sort' => $sort, 'order' => $order));
3434
}
3535

3636
/**
@@ -46,7 +46,7 @@ public function repositories($q, $sort = 'updated', $order = 'desc')
4646
*/
4747
public function issues($q, $sort = 'updated', $order = 'desc')
4848
{
49-
return $this->get('/search/issues', array('q' => $q, 'sort' => $sort, 'order' => $order));
49+
return $this->get('search/issues', array('q' => $q, 'sort' => $sort, 'order' => $order));
5050
}
5151

5252
/**
@@ -62,7 +62,7 @@ public function issues($q, $sort = 'updated', $order = 'desc')
6262
*/
6363
public function code($q, $sort = 'updated', $order = 'desc')
6464
{
65-
return $this->get('/search/code', array('q' => $q, 'sort' => $sort, 'order' => $order));
65+
return $this->get('search/code', array('q' => $q, 'sort' => $sort, 'order' => $order));
6666
}
6767

6868
/**
@@ -78,6 +78,6 @@ public function code($q, $sort = 'updated', $order = 'desc')
7878
*/
7979
public function users($q, $sort = 'updated', $order = 'desc')
8080
{
81-
return $this->get('/search/users', array('q' => $q, 'sort' => $sort, 'order' => $order));
81+
return $this->get('search/users', array('q' => $q, 'sort' => $sort, 'order' => $order));
8282
}
8383
}

test/Github/Tests/Api/SearchTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function shouldSearchRepositoriesByQuery()
1616
$api->expects($this->once())
1717
->method('get')
1818
->with(
19-
'/search/repositories',
19+
'search/repositories',
2020
array('q' => 'query text', 'sort' => 'updated', 'order' => 'desc')
2121
)
2222
->will($this->returnValue($expectedArray));
@@ -36,7 +36,7 @@ public function shouldSearchRepositoriesRegardingSortAndOrder()
3636
$api->expects($this->once())
3737
->method('get')
3838
->with(
39-
'/search/repositories',
39+
'search/repositories',
4040
array('q' => 'query text', 'sort' => 'created', 'order' => 'asc')
4141
)
4242
->will($this->returnValue($expectedArray));
@@ -59,7 +59,7 @@ public function shouldSearchIssuesByQuery()
5959
$api->expects($this->once())
6060
->method('get')
6161
->with(
62-
'/search/issues',
62+
'search/issues',
6363
array('q' => 'query text', 'sort' => 'updated', 'order' => 'desc')
6464
)
6565
->will($this->returnValue($expectedArray));
@@ -79,7 +79,7 @@ public function shouldSearchIssuesRegardingSortAndOrder()
7979
$api->expects($this->once())
8080
->method('get')
8181
->with(
82-
'/search/issues',
82+
'search/issues',
8383
array('q' => 'query text', 'sort' => 'created', 'order' => 'asc')
8484
)
8585
->will($this->returnValue($expectedArray));
@@ -102,7 +102,7 @@ public function shouldSearchCodeByQuery()
102102
$api->expects($this->once())
103103
->method('get')
104104
->with(
105-
'/search/code',
105+
'search/code',
106106
array('q' => 'query text', 'sort' => 'updated', 'order' => 'desc')
107107
)
108108
->will($this->returnValue($expectedArray));
@@ -122,7 +122,7 @@ public function shouldSearchCodeRegardingSortAndOrder()
122122
$api->expects($this->once())
123123
->method('get')
124124
->with(
125-
'/search/code',
125+
'search/code',
126126
array('q' => 'query text', 'sort' => 'created', 'order' => 'asc')
127127
)
128128
->will($this->returnValue($expectedArray));
@@ -145,7 +145,7 @@ public function shouldSearchUsersByQuery()
145145
$api->expects($this->once())
146146
->method('get')
147147
->with(
148-
'/search/users',
148+
'search/users',
149149
array('q' => 'query text', 'sort' => 'updated', 'order' => 'desc')
150150
)
151151
->will($this->returnValue($expectedArray));
@@ -165,7 +165,7 @@ public function shouldSearchUsersRegardingSortAndOrder()
165165
$api->expects($this->once())
166166
->method('get')
167167
->with(
168-
'/search/users',
168+
'search/users',
169169
array('q' => 'query text', 'sort' => 'created', 'order' => 'asc')
170170
)
171171
->will($this->returnValue($expectedArray));

0 commit comments

Comments
 (0)