From b880eab588207a884c056852a39a1c80a7ded4e1 Mon Sep 17 00:00:00 2001 From: Milwad Khosravi Date: Tue, 30 Jul 2024 11:15:17 +0330 Subject: [PATCH] add withoutHeaders method --- .../Testing/Concerns/MakesHttpRequests.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php b/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php index 85eabee130b6..1e0ee41c4df9 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php +++ b/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php @@ -103,6 +103,19 @@ public function withoutHeader(string $name) return $this; } + /** + * Remove headers from the request. + * + * @param array $headers + * @return $this + */ + public function withoutHeaders(array $headers) + { + $this->defaultHeaders = array_diff($this->defaultHeaders, $headers); + + return $this; + } + /** * Add an authorization token for the request. *