Skip to content

Commit 5eef5ee

Browse files
committed
add coverage
1 parent 1891330 commit 5eef5ee

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

src/Libraries/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function setFormType(string $form_type): self
156156
*/
157157
public function injectRequestHeader(array $headers): self
158158
{
159-
$this->responseHeaders = $headers;
159+
$this->requestHeaders = $headers;
160160
return $this;
161161
}
162162

tests/Libraries/ClientTest.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -180,33 +180,4 @@ public function testCallMultipartSuccess2(): void
180180
$r = json_decode($resp->getBody()->getContents());
181181
$this->assertEquals('101', $r->id);
182182
}
183-
184-
public function testCallMultipartSuccess3(): void
185-
{
186-
$request = new Request(
187-
'POST',
188-
'https://jsonplaceholder.typicode.com/posts',
189-
);
190-
$f = fopen('public/docs/hello.txt', 'w');
191-
fwrite($f, 'hello world');
192-
fclose($f);
193-
$f = fopen('public/docs/hello2.txt', 'w');
194-
fwrite($f, 'spotlibs the php library');
195-
fclose($f);
196-
$x = [];
197-
array_push($x, new \Illuminate\Http\UploadedFile('public/docs/hello.txt', 'hello.txt'));
198-
array_push($x, new \Illuminate\Http\UploadedFile('public/docs/hello.txt', 'hello2.txt'));
199-
$client = new Client();
200-
$resp = $client->setFormType(RequestOptions::MULTIPART)
201-
->setRequestBody([
202-
new Multipart([
203-
'name' => 'file[]',
204-
'contents' => $x
205-
])
206-
])
207-
->setVerify(true)
208-
->call($request);
209-
$r = json_decode($resp->getBody()->getContents());
210-
$this->assertEquals('101', $r->id);
211-
}
212183
}

0 commit comments

Comments
 (0)