Skip to content

Commit 72642a2

Browse files
authored
Support method PATCH for hyperf/testing. (#7553)
1 parent bda78d4 commit 72642a2

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/Concerns/MakesHttpRequests.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ protected function put($uri, array $data = [], array $headers = []): TestRespons
3434
return $this->doRequest(__FUNCTION__, $uri, $data, $headers);
3535
}
3636

37+
protected function patch($uri, array $data = [], array $headers = []): TestResponse
38+
{
39+
return $this->doRequest(__FUNCTION__, $uri, $data, $headers);
40+
}
41+
3742
protected function delete($uri, array $data = [], array $headers = []): TestResponse
3843
{
3944
return $this->doRequest(__FUNCTION__, $uri, $data, $headers);

src/Http/Client.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ public function put(string $uri, array $data = [], array $headers = [])
8181
]);
8282
}
8383

84+
public function patch(string $uri, array $data = [], array $headers = [])
85+
{
86+
return $this->request('PATCH', $uri, [
87+
'headers' => $headers,
88+
'form_params' => $data,
89+
]);
90+
}
91+
8492
public function delete(string $uri, array $data = [], array $headers = [])
8593
{
8694
return $this->request('DELETE', $uri, [

0 commit comments

Comments
 (0)