Skip to content

Commit 8804b27

Browse files
committed
Fix unittests
1 parent 47dc6b9 commit 8804b27

File tree

5 files changed

+37
-37
lines changed

5 files changed

+37
-37
lines changed

Tests/Package/Activity/EventsTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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

1010
use Joomla\Github\Package\Activity\Events;
1111
use Joomla\Github\Tests\Stub\GitHubTestCase;
@@ -106,7 +106,7 @@ public function testGetIssue()
106106
->with($path)
107107
->willReturn($this->response);
108108

109-
$response = json_decode($this->response->getBody()->getContents());
109+
$response = json_decode((string) $this->response->getBody());
110110

111111
$this->assertEquals(
112112
$response,
@@ -128,7 +128,7 @@ public function testGetNetwork()
128128
->with($path)
129129
->willReturn($this->response);
130130

131-
$response = json_decode($this->response->getBody()->getContents());
131+
$response = json_decode((string) $this->response->getBody());
132132

133133
$this->assertEquals(
134134
$response,
@@ -150,7 +150,7 @@ public function testGetOrg()
150150
->with($path)
151151
->willReturn($this->response);
152152

153-
$response = json_decode($this->response->getBody()->getContents());
153+
$response = json_decode((string) $this->response->getBody());
154154

155155
$this->assertEquals(
156156
$response,
@@ -172,7 +172,7 @@ public function testGetUser()
172172
->with($path)
173173
->willReturn($this->response);
174174

175-
$response = json_decode($this->response->getBody()->getContents());
175+
$response = json_decode((string) $this->response->getBody());
176176

177177
$this->assertEquals(
178178
$response,
@@ -194,7 +194,7 @@ public function testGetUserPublic()
194194
->with($path)
195195
->willReturn($this->response);
196196

197-
$response = json_decode($this->response->getBody()->getContents());
197+
$response = json_decode((string) $this->response->getBody());
198198

199199
$this->assertEquals(
200200
$response,
@@ -216,7 +216,7 @@ public function testGetByUser()
216216
->with($path)
217217
->willReturn($this->response);
218218

219-
$response = json_decode($this->response->getBody()->getContents());
219+
$response = json_decode((string) $this->response->getBody());
220220

221221
$this->assertEquals(
222222
$response,
@@ -238,7 +238,7 @@ public function testGetByUserPublic()
238238
->with($path)
239239
->willReturn($this->response);
240240

241-
$response = json_decode($this->response->getBody()->getContents());
241+
$response = json_decode((string) $this->response->getBody());
242242

243243
$this->assertEquals(
244244
$response,
@@ -260,7 +260,7 @@ public function testGetUserOrg()
260260
->with($path)
261261
->willReturn($this->response);
262262

263-
$response = json_decode($this->response->getBody()->getContents());
263+
$response = json_decode((string) $this->response->getBody());
264264

265265
$this->assertEquals(
266266
$response,

Tests/Package/Activity/NotificationsTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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

1010
use Joomla\Github\Package\Activity\Notifications;
1111
use Joomla\Github\Tests\Stub\GitHubTestCase;
@@ -189,7 +189,7 @@ public function testMarkReadRepositoryLastRead()
189189
->with('/repos/joomla/joomla-platform/notifications', $data, [], 0)
190190
->willReturn($this->response);
191191

192-
$response = $this->response->getBody()->getContents();
192+
$response = (string) $this->response->getBody();
193193

194194
$this->assertEquals(
195195
$response,
@@ -211,7 +211,7 @@ public function testViewThread()
211211
->with('/notifications/threads/1', [], 0)
212212
->willReturn($this->response);
213213

214-
$response = json_decode($this->response->getBody()->getContents());
214+
$response = json_decode((string) $this->response->getBody());
215215

216216
$this->assertEquals(
217217
$response,
@@ -235,7 +235,7 @@ public function testMarkReadThread()
235235
->with('/notifications/threads/1', '{"unread":true,"read":true}', [], 0)
236236
->willReturn($this->response);
237237

238-
$response = json_decode($this->response->getBody()->getContents());
238+
$response = json_decode((string) $this->response->getBody());
239239

240240
$this->assertEquals(
241241
$response,
@@ -257,7 +257,7 @@ public function testGetThreadSubscription()
257257
->with('/notifications/threads/1/subscription', [], 0)
258258
->willReturn($this->response);
259259

260-
$response = json_decode($this->response->getBody()->getContents());
260+
$response = json_decode((string) $this->response->getBody());
261261

262262
$this->assertEquals(
263263
$response,
@@ -279,7 +279,7 @@ public function testSetThreadSubscription()
279279
->with('/notifications/threads/1/subscription', '{"subscribed":true,"ignored":false}', [], 0)
280280
->willReturn($this->response);
281281

282-
$response = json_decode($this->response->getBody()->getContents());
282+
$response = json_decode((string) $this->response->getBody());
283283

284284
$this->assertEquals(
285285
$response,
@@ -303,7 +303,7 @@ public function testDeleteThreadSubscription()
303303
->with('/notifications/threads/1/subscription', [], 0)
304304
->willReturn($this->response);
305305

306-
$response = json_decode($this->response->getBody()->getContents());
306+
$response = json_decode((string) $this->response->getBody());
307307

308308
$this->assertEquals(
309309
$response,

Tests/Package/Activity/StarringTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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

1010
use Joomla\Github\Package\Activity\Starring;
1111
use Joomla\Github\Tests\Stub\GitHubTestCase;
@@ -178,7 +178,7 @@ public function testCheckFalse()
178178
->with('/user/starred/joomla/joomla-platform', [], 0)
179179
->willReturn($this->response);
180180

181-
$response = json_decode($this->response->getBody()->getContents());
181+
$response = json_decode((string) $this->response->getBody());
182182

183183
$this->assertEquals(
184184
$response,
@@ -204,7 +204,7 @@ public function testCheckUnexpected()
204204
->with('/user/starred/joomla/joomla-platform', [], 0)
205205
->willReturn($this->response);
206206

207-
$response = json_decode($this->response->getBody()->getContents());
207+
$response = json_decode((string) $this->response->getBody());
208208

209209
$this->assertEquals(
210210
$response,
@@ -228,7 +228,7 @@ public function testStar()
228228
->with('/user/starred/joomla/joomla-platform', '', [], 0)
229229
->willReturn($this->response);
230230

231-
$response = json_decode($this->response->getBody()->getContents());
231+
$response = json_decode((string) $this->response->getBody());
232232

233233
$this->assertEquals(
234234
$response,
@@ -252,7 +252,7 @@ public function testUnstar()
252252
->with('/user/starred/joomla/joomla-platform', [], 0)
253253
->willReturn($this->response);
254254

255-
$response = json_decode($this->response->getBody()->getContents());
255+
$response = json_decode((string) $this->response->getBody());
256256

257257
$this->assertEquals(
258258
$response,

Tests/Package/Repositories/ReleasesTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @license GNU General Public License version 2 or later; see LICENSE
55
*/
66

7-
namespace Joomla\Github\Tests;
7+
namespace Joomla\Github\Tests\Package\Repositories;
88

99
use Joomla\Github\Package\Repositories\Releases;
1010
use Joomla\Github\Tests\Stub\GitHubTestCase;
@@ -96,7 +96,7 @@ public function testCreateFailure()
9696
->with('/repos/joomla/joomla-platform/releases', $data, [], 0)
9797
->willReturn($this->response);
9898

99-
$response = json_decode($this->response->getBody()->getContents());
99+
$response = json_decode((string) $this->response->getBody());
100100

101101
$this->assertEquals(
102102
$response,
@@ -120,7 +120,7 @@ public function testEdit()
120120

121121
->willReturn($this->response);
122122

123-
$response = json_decode($this->response->getBody()->getContents());
123+
$response = json_decode((string) $this->response->getBody());
124124

125125
$this->assertEquals(
126126
$response,
@@ -139,7 +139,7 @@ public function testGetList()
139139

140140
$releases = [];
141141

142-
foreach (json_decode($this->response->getBody()->getContents()) as $i => $release) {
142+
foreach (json_decode((string) $this->response->getBody()) as $i => $release) {
143143
$releases[$i + 1] = $release;
144144
}
145145

@@ -148,7 +148,7 @@ public function testGetList()
148148
->with('/repos/joomla/joomla-platform/releases', [], 0)
149149
->willReturn($this->response);
150150

151-
$response = json_decode($this->response->getBody()->getContents());
151+
$response = json_decode((string) $this->response->getBody());
152152

153153
$this->assertEquals(
154154
$releases,
@@ -170,7 +170,7 @@ public function testDelete()
170170
->with('/repos/joomla/joomla-platform/releases/123')
171171
->willReturn($this->response);
172172

173-
$response = json_decode($this->response->getBody()->getContents());
173+
$response = json_decode((string) $this->response->getBody());
174174

175175
$this->assertEquals(
176176
$response,
@@ -194,7 +194,7 @@ public function testGetLatest()
194194
->with('/repos/joomla/joomla-platform/releases/latest', [], 0)
195195
->willReturn($this->response);
196196

197-
$response = json_decode($this->response->getBody()->getContents());
197+
$response = json_decode((string) $this->response->getBody());
198198

199199
$this->assertEquals(
200200
$response,
@@ -214,7 +214,7 @@ public function testGetByTag()
214214
->with('/repos/joomla/joomla-platform/releases/tags/{tag}', [], 0)
215215
->willReturn($this->response);
216216

217-
$response = json_decode($this->response->getBody()->getContents());
217+
$response = json_decode((string) $this->response->getBody());
218218

219219
$this->assertEquals(
220220
$response,
@@ -234,7 +234,7 @@ public function testGetListAssets()
234234
->with('/repos/joomla/joomla-platform/releases/123/assets', [], 0)
235235
->willReturn($this->response);
236236

237-
$response = json_decode($this->response->getBody()->getContents());
237+
$response = json_decode((string) $this->response->getBody());
238238

239239
$this->assertEquals(
240240
$response,
@@ -254,7 +254,7 @@ public function testGetAsset()
254254
->with('/repos/joomla/joomla-platform/releases/assets/123', [], 0)
255255
->willReturn($this->response);
256256

257-
$response = json_decode($this->response->getBody()->getContents());
257+
$response = json_decode((string) $this->response->getBody());
258258

259259
$this->assertEquals(
260260
$response,
@@ -276,7 +276,7 @@ public function testEditAsset()
276276
->with('/repos/joomla/joomla-platform/releases/assets/123', $data, [], 0)
277277
->willReturn($this->response);
278278

279-
$response = json_decode($this->response->getBody()->getContents());
279+
$response = json_decode((string) $this->response->getBody());
280280

281281
$this->assertEquals(
282282
$response,

Tests/Package/UsersTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @license GNU General Public License version 2 or later; see LICENSE
55
*/
66

7-
namespace Joomla\Github\Tests;
7+
namespace Joomla\Github\Tests\Package;
88

99
use Joomla\Github\Package\Users;
1010
use Joomla\Github\Tests\Stub\GitHubTestCase;
@@ -176,7 +176,7 @@ public function testGetAuthenticatedUserFailure()
176176
->with('/user', [], 0)
177177
->willReturn($this->response);
178178

179-
$response = json_decode($this->response->getBody()->getContents());
179+
$response = json_decode((string) $this->response->getBody());
180180

181181
$this->assertEquals(
182182
$response,
@@ -216,7 +216,7 @@ public function testGetList()
216216
->with('/users', [], 0)
217217
->willReturn($this->response);
218218

219-
$response = json_decode($this->response->getBody()->getContents());
219+
$response = json_decode((string) $this->response->getBody());
220220

221221
$this->assertEquals(
222222
$response,
@@ -289,7 +289,7 @@ public function testEdit()
289289
->with('/user', $input, [], 0)
290290
->willReturn($this->response);
291291

292-
$response = json_decode($this->response->getBody()->getContents());
292+
$response = json_decode((string) $this->response->getBody());
293293

294294
$this->assertEquals(
295295
$response,
@@ -336,7 +336,7 @@ public function testEditFailure()
336336
// $this->object->edit($name, $email, $blog, $company, $location, $hireable, $bio);
337337

338338
$this->assertEquals(
339-
json_decode($this->response->getBody()->getContents()),
339+
json_decode((string) $this->response->getBody()),
340340
$this->object->edit($name, $email, $blog, $company, $location, $hireable, $bio)
341341
);
342342
}

0 commit comments

Comments
 (0)