Skip to content

Commit

Permalink
Fix ResponseSenderTest http_response_code handling
Browse files Browse the repository at this point in the history
  • Loading branch information
donatj committed Nov 27, 2023
1 parent 65097aa commit b94a160
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/ResponseSenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ public function testSend( bool $fullStmt ) : void {
return $sent_headers[] = [ $header, $replace ];
});

if( !$fullStmt ) {
$http_response_code = $this->getFunctionMock(__NAMESPACE__, 'http_response_code');
$http_response_code
->expects($this->once())
->with($status);
}


$sender = new ResponseSender($fullStmt);

ob_start();
Expand All @@ -49,7 +57,7 @@ public function testSend( bool $fullStmt ) : void {
];

if( $fullStmt ) {
array_unshift($expectedHeaders, ["HTTP/$version $status OK", true]);
array_unshift($expectedHeaders, [ "HTTP/$version $status OK", true ]);
}

$this->assertSame($expectedHeaders, $sent_headers);
Expand Down

0 comments on commit b94a160

Please sign in to comment.