Skip to content

Commit

Permalink
Remove ResponseEmitter tests relating to headers removal on empty body
Browse files Browse the repository at this point in the history
  • Loading branch information
proton-ab authored Jan 29, 2020
1 parent cca7b03 commit f087928
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions tests/ResponseEmitterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,42 +58,6 @@ public function testRespond()
$this->expectOutputString('Hello');
}

public function testResposeWithNoContentSkipsContentTypeAndContentLength()
{
$response = $this
->createResponse()
->withHeader('Content-Type', 'text/html')
->withHeader('Content-Length', '4096')
->withHeader('Cache-Control', 'no-cache');

$responseEmitter = new ResponseEmitter();
$responseEmitter->emit($response);

$this->assertFalse(HeaderStack::has('Content-Type'));
$this->assertFalse(HeaderStack::has('Content-Length'));
$this->assertTrue(HeaderStack::has('Cache-Control'));
$this->expectOutputString('');
}

public function testNonEmptyResponseDoesNotSkipContentTypeAndContentLength()
{
$response = $this
->createResponse()
->withHeader('Content-Type', 'text/html')
->withHeader('Content-Length', '4096')
->withHeader('Cache-Control', 'no-cache');

$response->getBody()->write('foo');

$responseEmitter = new ResponseEmitter();
$responseEmitter->emit($response);

$this->assertTrue(HeaderStack::has('Content-Type'));
$this->assertTrue(HeaderStack::has('Content-Length'));
$this->assertTrue(HeaderStack::has('Cache-Control'));
$this->expectOutputString('foo');
}

public function testRespondWithPaddedStreamFilterOutput()
{
$availableFilter = stream_get_filters();
Expand Down

0 comments on commit f087928

Please sign in to comment.