File tree Expand file tree Collapse file tree 3 files changed +10
-14
lines changed Expand file tree Collapse file tree 3 files changed +10
-14
lines changed Original file line number Diff line number Diff line change 10
10
*/
11
11
class RateLimit extends AbstractApi
12
12
{
13
-
14
13
/**
15
14
* Get rate limits
16
15
*
@@ -42,5 +41,4 @@ public function getSearchLimit()
42
41
$ response = $ this ->getRateLimits ();
43
42
return $ response ['resources ' ]['search ' ]['limit ' ];
44
43
}
45
-
46
44
}
Original file line number Diff line number Diff line change 4
4
5
5
class RateLimitTest extends TestCase
6
6
{
7
-
8
7
/**
9
8
* @test
10
9
*/
11
10
public function shouldReturnRateLimitArray ()
12
11
{
13
- $ expectedArray = [
14
- 'resources ' => [
15
- 'core ' => [
12
+ $ expectedArray = array (
13
+ 'resources ' => array (
14
+ 'core ' => array (
16
15
'limit ' => 5000 ,
17
16
'remaining ' => 4999 ,
18
17
'reset ' => 1372700873
19
- ] ,
20
- 'search ' => [
18
+ ) ,
19
+ 'search ' => array (
21
20
'limit ' => 30 ,
22
21
'remaining ' => 18 ,
23
22
'reset ' => 1372697452
24
- ]
25
- ]
26
- ] ;
23
+ )
24
+ )
25
+ ) ;
27
26
28
27
$ api = $ this ->getApiMock ();
29
28
$ api ->expects ($ this ->once ())
@@ -38,4 +37,5 @@ protected function getApiClass()
38
37
{
39
38
return 'Github\Api\RateLimit ' ;
40
39
}
40
+
41
41
}
Original file line number Diff line number Diff line change @@ -15,8 +15,6 @@ public function shouldRetrievedRateLimits()
15
15
$ response = $ this ->client ->api ('rate_limit ' )->getRateLimits ();
16
16
17
17
$ this ->assertArrayHasKey ('resources ' , $ response );
18
- $ this ->assertArraySubset (['resources ' => ['core ' => ['limit ' => 60 ]]], $ response );
19
-
18
+ $ this ->assertArraySubset (array ('resources ' => array ('core ' => array ('limit ' => 60 ))), $ response );
20
19
}
21
-
22
20
}
You can’t perform that action at this time.
0 commit comments