55 * @license GNU General Public License version 2 or later; see LICENSE
66 */
77
8- namespace Joomla \Github \Tests ;
8+ namespace Joomla \Github \Tests \ Package \ Activity ;
99
1010use Joomla \Github \Package \Activity \Notifications ;
1111use Joomla \Github \Tests \Stub \GitHubTestCase ;
@@ -54,8 +54,7 @@ public function testGetList()
5454 ->with ('/notifications?all=1&participating=1&since=2005-08-17T00:00:00+00:00&before=2005-08-17T00:00:00+00:00 ' , [], 0 )
5555 ->willReturn ($ this ->response );
5656
57- $ response = json_decode ($ this ->response ->getBody ()->getContents ());
58- $ this ->response ->getBody ()->rewind ();
57+ $ response = json_decode ((string ) $ this ->response ->getBody ());
5958
6059 $ this ->assertEquals (
6160 $ response ,
@@ -79,8 +78,7 @@ public function testGetListRepository()
7978 ->with ('/repos/{owner}/{repo}/notifications? ' . $ args , [], 0 )
8079 ->willReturn ($ this ->response );
8180
82- $ response = json_decode ($ this ->response ->getBody ()->getContents ());
83- $ this ->response ->getBody ()->rewind ();
81+ $ response = json_decode ((string ) $ this ->response ->getBody ());
8482
8583 $ this ->assertEquals (
8684 $ response ,
@@ -111,8 +109,7 @@ public function testMarkRead()
111109 ->with ('/notifications ' , '{"unread":true,"read":true} ' , [], 0 )
112110 ->willReturn ($ this ->response );
113111
114- $ response = $ this ->response ->getBody ()->getContents ();
115- $ this ->response ->getBody ()->rewind ();
112+ $ response = (string ) $ this ->response ->getBody ();
116113
117114 $ this ->assertEquals (
118115 $ response ,
@@ -139,8 +136,7 @@ public function testMarkReadLastRead()
139136 ->with ('/notifications ' , $ data , [], 0 )
140137 ->willReturn ($ this ->response );
141138
142- $ response = $ this ->response ->getBody ()->getContents ();
143- $ this ->response ->getBody ()->rewind ();
139+ $ response = (string ) $ this ->response ->getBody ();
144140
145141 $ this ->assertEquals (
146142 $ response ,
@@ -166,8 +162,7 @@ public function testMarkReadRepository()
166162 ->with ('/repos/joomla/joomla-platform/notifications ' , $ data , [], 0 )
167163 ->willReturn ($ this ->response );
168164
169- $ response = $ this ->response ->getBody ()->getContents ();
170- $ this ->response ->getBody ()->rewind ();
165+ $ response = (string ) $ this ->response ->getBody ();
171166
172167 $ this ->assertEquals (
173168 $ response ,
@@ -194,8 +189,7 @@ public function testMarkReadRepositoryLastRead()
194189 ->with ('/repos/joomla/joomla-platform/notifications ' , $ data , [], 0 )
195190 ->willReturn ($ this ->response );
196191
197- $ response = $ this ->response ->getBody ()->getContents ();
198- $ this ->response ->getBody ()->rewind ();
192+ $ response = (string ) $ this ->response ->getBody ();
199193
200194 $ this ->assertEquals (
201195 $ response ,
@@ -217,8 +211,7 @@ public function testViewThread()
217211 ->with ('/notifications/threads/1 ' , [], 0 )
218212 ->willReturn ($ this ->response );
219213
220- $ response = json_decode ($ this ->response ->getBody ()->getContents ());
221- $ this ->response ->getBody ()->rewind ();
214+ $ response = json_decode ((string ) $ this ->response ->getBody ());
222215
223216 $ this ->assertEquals (
224217 $ response ,
@@ -242,8 +235,7 @@ public function testMarkReadThread()
242235 ->with ('/notifications/threads/1 ' , '{"unread":true,"read":true} ' , [], 0 )
243236 ->willReturn ($ this ->response );
244237
245- $ response = json_decode ($ this ->response ->getBody ()->getContents ());
246- $ this ->response ->getBody ()->rewind ();
238+ $ response = json_decode ((string ) $ this ->response ->getBody ());
247239
248240 $ this ->assertEquals (
249241 $ response ,
@@ -265,8 +257,7 @@ public function testGetThreadSubscription()
265257 ->with ('/notifications/threads/1/subscription ' , [], 0 )
266258 ->willReturn ($ this ->response );
267259
268- $ response = json_decode ($ this ->response ->getBody ()->getContents ());
269- $ this ->response ->getBody ()->rewind ();
260+ $ response = json_decode ((string ) $ this ->response ->getBody ());
270261
271262 $ this ->assertEquals (
272263 $ response ,
@@ -288,8 +279,7 @@ public function testSetThreadSubscription()
288279 ->with ('/notifications/threads/1/subscription ' , '{"subscribed":true,"ignored":false} ' , [], 0 )
289280 ->willReturn ($ this ->response );
290281
291- $ response = json_decode ($ this ->response ->getBody ()->getContents ());
292- $ this ->response ->getBody ()->rewind ();
282+ $ response = json_decode ((string ) $ this ->response ->getBody ());
293283
294284 $ this ->assertEquals (
295285 $ response ,
@@ -313,8 +303,7 @@ public function testDeleteThreadSubscription()
313303 ->with ('/notifications/threads/1/subscription ' , [], 0 )
314304 ->willReturn ($ this ->response );
315305
316- $ response = json_decode ($ this ->response ->getBody ()->getContents ());
317- $ this ->response ->getBody ()->rewind ();
306+ $ response = json_decode ((string ) $ this ->response ->getBody ());
318307
319308 $ this ->assertEquals (
320309 $ response ,
0 commit comments