Skip to content

Commit 0091853

Browse files
Stephan Wentztemp
authored andcommitted
fix: Allow data multi-parts
1 parent 7fec733 commit 0091853

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/HttpClientMock/MockRequestBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,11 @@ public function hasRequestParams(): bool
279279
return (bool) preg_match('/[^=]+=[^=]*(&[^=]+=[^=]*)*/', (string) $this->content) && !$this->isJson();
280280
}
281281

282-
public function multipartFile(string $name, string $filename, string $mimetype, int $size): self
282+
public function multipartFile(string $name, string|null $filename, string $mimetype, int $size): self
283283
{
284284
$this->multiparts ??= [];
285285
$this->multiparts[$name] = [
286-
'type' => 'file',
286+
'type' => $filename !== null ? 'file' : 'data',
287287
'filename' => $filename,
288288
'mimetype' => $mimetype,
289289
'size' => $size,

0 commit comments

Comments
 (0)