Skip to content

Commit 350716b

Browse files
authored
Adding tests for S3 Result (#194)
* Adding tests for S3 Result * Sneak in a lambda test
1 parent d86831a commit 350716b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Test/Http/SimpleMockedResponse.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,19 @@ class SimpleMockedResponse implements ResponseInterface
1515
private $statusCode;
1616

1717
/**
18-
* @param array $headers ['name'=>'value']
18+
* @param array $headers ['name'=>'value'] OR ['name'=>['value']]
1919
*/
2020
public function __construct(string $content = '', array $headers = [], int $statusCode = 200)
2121
{
2222
$this->content = $content;
23-
$this->headers = $headers;
2423
$this->statusCode = $statusCode;
24+
$this->headers = [];
25+
foreach ($headers as $name => $value) {
26+
if (!\is_array($value)) {
27+
$value = [$value];
28+
}
29+
$this->headers[$name] = $value;
30+
}
2531
}
2632

2733
public function getStatusCode(): int
@@ -71,7 +77,7 @@ private function getFlatHeaders()
7177
{
7278
$flat = [];
7379
foreach ($this->headers as $name => $value) {
74-
$flat[] = sprintf('%s: %s', $name, $value);
80+
$flat[] = sprintf('%s: %s', $name, implode(';', $value));
7581
}
7682

7783
return $flat;

0 commit comments

Comments
 (0)