|
9 | 9 | use App\Slack\Domain\WebAPIMessage; |
10 | 10 | use App\Slack\Response\SlackResponse; |
11 | 11 | use App\Slack\SlackClient; |
| 12 | +use AppTest\Psr7Helper; |
12 | 13 | use PHPUnit\Framework\TestCase; |
13 | 14 | use Prophecy\Argument; |
14 | 15 | use Prophecy\PhpUnit\ProphecyTrait; |
@@ -59,9 +60,9 @@ public function testSendReturnsReceivedResponseOnSuccess(): void |
59 | 60 | $response = $this->prophesize(ResponseInterface::class); |
60 | 61 | $response |
61 | 62 | ->getBody() |
62 | | - ->willReturn(json_encode([ |
| 63 | + ->willReturn(Psr7Helper::stream(json_encode([ |
63 | 64 | 'ok' => true, |
64 | | - ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)) |
| 65 | + ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES))) |
65 | 66 | ->shouldBeCalled(); |
66 | 67 |
|
67 | 68 | $this->httpClient |
@@ -89,10 +90,10 @@ public function testSendLogsResponseOnFailureBeforeReturning(): void |
89 | 90 | $response->getStatusCode()->willReturn(400)->shouldBeCalled(); |
90 | 91 | $response |
91 | 92 | ->getBody() |
92 | | - ->willReturn(json_encode([ |
| 93 | + ->willReturn(Psr7Helper::stream(json_encode([ |
93 | 94 | 'ok' => false, |
94 | 95 | 'error' => 'the error message', |
95 | | - ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)) |
| 96 | + ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES))) |
96 | 97 | ->shouldBeCalled(); |
97 | 98 |
|
98 | 99 | $this->httpClient |
@@ -180,9 +181,9 @@ public function testSendWebhookMessageMarshalsRequestFromMessageAndSendsIt(): vo |
180 | 181 | $response = $this->prophesize(ResponseInterface::class); |
181 | 182 | $response |
182 | 183 | ->getBody() |
183 | | - ->willReturn(json_encode([ |
| 184 | + ->willReturn(Psr7Helper::stream(json_encode([ |
184 | 185 | 'ok' => true, |
185 | | - ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)) |
| 186 | + ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES))) |
186 | 187 | ->shouldBeCalled(); |
187 | 188 |
|
188 | 189 | $this->httpClient |
@@ -257,9 +258,9 @@ public function testSendWebAPIMessageMarshalsRequestFromMessageAndSendsIt(): voi |
257 | 258 | $response = $this->prophesize(ResponseInterface::class); |
258 | 259 | $response |
259 | 260 | ->getBody() |
260 | | - ->willReturn(json_encode([ |
| 261 | + ->willReturn(Psr7Helper::stream(json_encode([ |
261 | 262 | 'ok' => true, |
262 | | - ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)) |
| 263 | + ], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES))) |
263 | 264 | ->shouldBeCalled(); |
264 | 265 |
|
265 | 266 | $this->httpClient |
|
0 commit comments