Skip to content

Commit 9fa5752

Browse files
Fix compat with http-client-contracts v3 (#1044)
1 parent 84c1af6 commit 9fa5752

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

src/Test/Http/SimpleMockedResponse.php

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ public function __construct(string $content = '', array $headers = [], int $stat
3333
$this->headers[$name] = $value;
3434
}
3535

36-
parent::__construct($content, ['response_headers' => $headers, 'http_code' => $statusCode]);
36+
parent::__construct($content, [
37+
'response_headers' => $this->getFlatHeaders(),
38+
'http_code' => $statusCode,
39+
]);
3740
}
3841

3942
public function getStatusCode(): int
@@ -61,27 +64,6 @@ public function cancel(): void
6164
throw new LogicException('Not implemented');
6265
}
6366

64-
/**
65-
* @return mixed
66-
*/
67-
public function getInfo(string $type = null)
68-
{
69-
$info = [
70-
'response_headers' => $this->getFlatHeaders(),
71-
'http_code' => $this->statusCode,
72-
];
73-
74-
if (null === $type) {
75-
return $info;
76-
}
77-
78-
if (isset($info[$type])) {
79-
return $info[$type];
80-
}
81-
82-
return 'info: ' . $type;
83-
}
84-
8567
private function getFlatHeaders()
8668
{
8769
$flat = [];

tests/Unit/Exception/Http/ClientExceptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function testException()
2222
self::assertEquals('code', $exception->getAwsCode());
2323
self::assertEquals('type', $exception->getAwsType());
2424
self::assertEquals('detail', $exception->getAwsDetail());
25-
self::assertStringContainsString('HTTP 400 returned for "info: url".', $exception->getMessage());
25+
self::assertStringContainsString('HTTP 400 returned for "".', $exception->getMessage());
2626
self::assertStringContainsString('Message: message', $exception->getMessage());
2727
}
2828
}

0 commit comments

Comments
 (0)