File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,19 @@ public function removeHeaders() : static
201201 return parent ::removeHeaders ();
202202 }
203203
204+ /**
205+ * @param array<string> $names
206+ *
207+ * @see Response::removeHeader()
208+ *
209+ * @return static
210+ */
211+ #[Override]
212+ public function removeHeadersByNames (array $ names ) : static
213+ {
214+ return parent ::removeHeadersByNames ($ names );
215+ }
216+
204217 /**
205218 * Set the Content-Security-Policy instance.
206219 *
Original file line number Diff line number Diff line change @@ -314,6 +314,21 @@ public function testHeader() : void
314314 self ::assertSame ([], $ this ->response ->getHeaders ());
315315 }
316316
317+ public function testRemoveHeadersByNames () : void
318+ {
319+ self ::assertSame ([], $ this ->response ->getHeaders ());
320+ $ this ->response ->setHeader ('content-type ' , 'text/html ' );
321+ $ this ->response ->setHeader ('foo ' , 'bar ' );
322+ self ::assertSame ([
323+ 'content-type ' => 'text/html ' ,
324+ 'foo ' => 'bar ' ,
325+ ], $ this ->response ->getHeaders ());
326+ $ this ->response ->removeHeadersByNames (['content-type ' ]);
327+ self ::assertSame ([
328+ 'foo ' => 'bar ' ,
329+ ], $ this ->response ->getHeaders ());
330+ }
331+
317332 public function testHeadersAreAlreadySent () : void
318333 {
319334 $ response = new class (new RequestMock (['domain.tld ' ])) extends Response {
You can’t perform that action at this time.
0 commit comments