Skip to content

Commit 901b88a

Browse files
committed
fix test
1 parent 83c2d9c commit 901b88a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

integration/php/main.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ function assertThrowException(\SDK\Client $client): void
9393

9494
function assertBinary(\SDK\Client $client): void
9595
{
96-
$payload = \GuzzleHttp\Stream\Stream::factory('foobar');
96+
$handle = fopen('php://memory', 'w+');
97+
fwrite($handle, 'foobar');
98+
fseek($handle, 0);
99+
100+
$payload = new \GuzzleHttp\Psr7\Stream($handle);
97101

98102
$response = $client->test()->binary($payload);
99103

@@ -119,7 +123,7 @@ function assertJson(\SDK\Client $client): void
119123

120124
$response = $client->test()->json($payload);
121125

122-
if ($payload !== $response) {
126+
if (\json_encode($payload) !== \json_encode($response)) {
123127
throw new RuntimeException("Test assertJson failed");
124128
}
125129
}
@@ -128,7 +132,7 @@ function assertText(\SDK\Client $client): void
128132
{
129133
$payload = 'foobar';
130134

131-
$response = $client->test()->json($payload);
135+
$response = $client->test()->text($payload);
132136

133137
if ($payload !== $response) {
134138
throw new RuntimeException("Test assertText failed");

0 commit comments

Comments
 (0)