@@ -25,7 +25,7 @@ public function shouldGetAllResults()
2525 {
2626 $ amountLoops = 3 ;
2727 $ content = array (1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 );
28- $ responseMock = new TestResponse ( $ amountLoops , $ content );
28+ $ responseMock = new TestResponse ($ amountLoops , $ content );
2929
3030 // httpClient mock
3131 $ httpClientMock = $ this ->getHttpClientMock ($ responseMock );
@@ -37,7 +37,7 @@ public function shouldGetAllResults()
3737 $ clientMock = $ this ->getClientMock ($ httpClientMock );
3838
3939 // memberApi Mock
40- $ memberApiMock = $ this ->getApiMock ( 'Github\Api\Organization\Members ' );
40+ $ memberApiMock = $ this ->getApiMock ('Github\Api\Organization\Members ' );
4141 $ memberApiMock
4242 ->expects ($ this ->once ())
4343 ->method ('all ' )
@@ -47,8 +47,8 @@ public function shouldGetAllResults()
4747 $ parameters = array ('netwerven ' );
4848
4949 // Run fetchAll on result paginator
50- $ paginator = new Github \ResultPager ( $ clientMock );
51- $ result = $ paginator ->fetchAll ( $ memberApiMock , $ method , $ parameters );
50+ $ paginator = new Github \ResultPager ($ clientMock );
51+ $ result = $ paginator ->fetchAll ($ memberApiMock , $ method , $ parameters );
5252
5353 $ this ->assertEquals ($ amountLoops * count ($ content ), count ($ result ));
5454 }
@@ -64,19 +64,19 @@ public function shouldGetSomeResults()
6464 $ resultContent = 'organization test ' ;
6565
6666 $ responseMock = $ this ->getResponseMock ($ pagination );
67- $ httpClient = $ this ->getHttpClientMock ( $ responseMock );
67+ $ httpClient = $ this ->getHttpClientMock ($ responseMock );
6868 $ client = $ this ->getClientMock ($ httpClient );
6969
70- $ organizationApiMock = $ this ->getApiMock ( 'Github\Api\Organization ' );
70+ $ organizationApiMock = $ this ->getApiMock ('Github\Api\Organization ' );
7171
7272 $ organizationApiMock
7373 ->expects ($ this ->once ())
7474 ->method ('show ' )
7575 ->with ('github ' )
7676 ->will ($ this ->returnValue ($ resultContent ));
7777
78- $ paginator = new Github \ResultPager ( $ client );
79- $ result = $ paginator ->fetch ($ organizationApiMock , 'show ' , 'github ' );
78+ $ paginator = new Github \ResultPager ($ client );
79+ $ result = $ paginator ->fetch ($ organizationApiMock , 'show ' , array ( 'github ' ) );
8080
8181 $ this ->assertEquals ($ resultContent , $ result );
8282 $ this ->assertEquals ($ pagination , $ paginator ->getPagination ());
@@ -103,10 +103,10 @@ public function postFetch()
103103 ->method ('getPagination ' )
104104 ->will ($ this ->returnValue ($ pagination ));
105105
106- $ httpClient = $ this ->getHttpClientMock ( $ responseMock );
106+ $ httpClient = $ this ->getHttpClientMock ($ responseMock );
107107 $ client = $ this ->getClientMock ($ httpClient );
108108
109- $ paginator = new Github \ResultPager ( $ client );
109+ $ paginator = new Github \ResultPager ($ client );
110110 $ paginator ->postFetch ();
111111
112112 $ this ->assertEquals ($ paginator ->getPagination (), $ pagination );
@@ -122,7 +122,7 @@ public function fetchNext()
122122 $ pagination = array ('next ' => 'http://github.com/next ' );
123123 $ resultContent = 'fetch test ' ;
124124
125- $ responseMock = $ this ->getResponseMock ( $ pagination );
125+ $ responseMock = $ this ->getResponseMock ($ pagination );
126126 $ responseMock
127127 ->expects ($ this ->once ())
128128 ->method ('getContent ' )
@@ -132,17 +132,17 @@ public function fetchNext()
132132 ->expects ($ this ->exactly (2 ))
133133 ->method ('getPagination ' );
134134
135- $ httpClient = $ this ->getHttpClientMock ( $ responseMock );
135+ $ httpClient = $ this ->getHttpClientMock ($ responseMock );
136136
137137 $ httpClient
138138 ->expects ($ this ->once ())
139139 ->method ('get ' )
140- ->with ( $ pagination ['next ' ] )
140+ ->with ($ pagination ['next ' ])
141141 ->will ($ this ->returnValue ($ responseMock ));
142142
143143 $ client = $ this ->getClientMock ($ httpClient );
144144
145- $ paginator = new Github \ResultPager ( $ client );
145+ $ paginator = new Github \ResultPager ($ client );
146146 $ paginator ->postFetch ();
147147
148148 $ this ->assertEquals ($ paginator ->fetchNext (), $ resultContent );
@@ -156,10 +156,10 @@ public function fetchNext()
156156 public function shouldHaveNext ()
157157 {
158158 $ responseMock = $ this ->getResponseMock (array ('next ' => 'http://github.com/next ' ));
159- $ httpClient = $ this ->getHttpClientMock ( $ responseMock );
159+ $ httpClient = $ this ->getHttpClientMock ($ responseMock );
160160 $ client = $ this ->getClientMock ($ httpClient );
161161
162- $ paginator = new Github \ResultPager ( $ client );
162+ $ paginator = new Github \ResultPager ($ client );
163163 $ paginator ->postFetch ();
164164
165165 $ this ->assertEquals ($ paginator ->hasNext (), true );
@@ -174,34 +174,32 @@ public function shouldHaveNext()
174174 public function shouldHavePrevious ()
175175 {
176176 $ responseMock = $ this ->getResponseMock (array ('prev ' => 'http://github.com/previous ' ));
177- $ httpClient = $ this ->getHttpClientMock ( $ responseMock );
177+ $ httpClient = $ this ->getHttpClientMock ($ responseMock );
178178 $ client = $ this ->getClientMock ($ httpClient );
179179
180- $ paginator = new Github \ResultPager ( $ client );
180+ $ paginator = new Github \ResultPager ($ client );
181181 $ paginator ->postFetch ();
182182
183183 $ this ->assertEquals ($ paginator ->hasPrevious (), true );
184184 $ this ->assertEquals ($ paginator ->hasNext (), false );
185185 }
186186
187- protected function getResponseMock ( array $ pagination )
187+ protected function getResponseMock (array $ pagination )
188188 {
189189 // response mock
190190 $ responseMock = $ this ->getMock ('Github\HttpClient\Message\Response ' );
191191 $ responseMock
192192 ->expects ($ this ->any ())
193193 ->method ('getPagination ' )
194- ->will ($ this ->returnValue (
195- $ pagination
196- ));
194+ ->will ($ this ->returnValue ($ pagination ));
197195
198196 return $ responseMock ;
199197 }
200198
201- protected function getClientMock ( HttpClientInterface $ httpClient = null )
199+ protected function getClientMock (HttpClientInterface $ httpClient = null )
202200 {
203201 // if no httpClient isset use the default HttpClient mock
204- if ( !$ httpClient ) {
202+ if ( !$ httpClient) {
205203 $ httpClient = $ this ->getHttpClientMock ();
206204 }
207205
@@ -211,7 +209,7 @@ protected function getClientMock( HttpClientInterface $httpClient = null )
211209 return $ client ;
212210 }
213211
214- protected function getHttpClientMock ( $ responseMock = null )
212+ protected function getHttpClientMock ($ responseMock = null )
215213 {
216214 // mock the client interface
217215 $ clientInterfaceMock = $ this ->getMock ('Buzz\Client\ClientInterface ' , array ('setTimeout ' , 'setVerifyPeer ' , 'send ' ));
@@ -230,7 +228,7 @@ protected function getHttpClientMock( $responseMock = null )
230228 // create the httpClient mock
231229 $ httpClientMock = $ this ->getMock ('Github\HttpClient\HttpClient ' , array (), array (array (), $ clientInterfaceMock ));
232230
233- if ( $ responseMock ) {
231+ if ( $ responseMock) {
234232 $ httpClientMock
235233 ->expects ($ this ->any ())
236234 ->method ('getLastResponse ' )
@@ -240,12 +238,12 @@ protected function getHttpClientMock( $responseMock = null )
240238 return $ httpClientMock ;
241239 }
242240
243- protected function getApiMock ( $ apiClass )
241+ protected function getApiMock ($ apiClass )
244242 {
245243 $ client = $ this ->getClientMock ();
246244
247- return $ this ->getMockBuilder ( $ apiClass )
245+ return $ this ->getMockBuilder ($ apiClass )
248246 ->setConstructorArgs (array ($ client ))
249247 ->getMock ();
250248 }
251- }
249+ }
0 commit comments