File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
lib/internal/Magento/Framework/App Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ public function getHeader($name)
152152 */
153153 public function clearHeader ($ name )
154154 {
155- return $ this ->response ->clearHeader ($ name );
155+ $ this ->response ->clearHeader ($ name );
156+ return $ this ;
156157 }
157158}
Original file line number Diff line number Diff line change @@ -266,6 +266,36 @@ public function testSendResponseWithRemoveOption(): void
266266 $ this ->getModel ($ options )->sendResponse ();
267267 }
268268
269+ public function testSetHeader (): void
270+ {
271+ $ model = $ this ->getModel ();
272+ $ this ->responseMock ->expects ($ this ->once ())
273+ ->method ('setHeader ' )
274+ ->with ('Content-type ' , 1024 , true )
275+ ->willReturnSelf ();
276+ $ this ->assertSame ($ model , $ model ->setHeader ('Content-type ' , 1024 , true ));
277+ }
278+
279+ public function testGetHeader (): void
280+ {
281+ $ model = $ this ->getModel ();
282+ $ this ->responseMock ->expects ($ this ->once ())
283+ ->method ('getHeader ' )
284+ ->with ('Content-type ' )
285+ ->willReturn (2048 );
286+ $ this ->assertEquals (2048 , $ model ->getHeader ('Content-type ' ));
287+ }
288+
289+ public function testClearHeader (): void
290+ {
291+ $ model = $ this ->getModel ();
292+ $ this ->responseMock ->expects ($ this ->once ())
293+ ->method ('clearHeader ' )
294+ ->with ('Content-type ' )
295+ ->willReturnSelf ();
296+ $ this ->assertSame ($ model , $ model ->clearHeader ('Content-type ' ));
297+ }
298+
269299 private function getModel (array $ options = []): File
270300 {
271301 return new File (
You can’t perform that action at this time.
0 commit comments