Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
Clean up output buffer for legacy test
Browse files Browse the repository at this point in the history
  • Loading branch information
jasny committed Jan 26, 2017
1 parent 75ceb1f commit eebdc0e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/LegacyCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,16 @@ public function setUp()
'cookie' => $_COOKIE,
'server' => $_SERVER
];

ob_start();
}

public function tearDown()
{
ob_end_clean();
}


/**
* Initialize the request
*
Expand Down Expand Up @@ -137,8 +145,6 @@ protected function assertCleanedEnvironment()
*/
public function test()
{
ob_start();

// Create server request with (actual) global enviroment.
$request = (new ServerRequest())->withGlobalEnvironment(true);

Expand Down Expand Up @@ -176,6 +182,5 @@ public function test()
$this->assertEquals('http://example.com/foo/1', $finalResponse->getHeaderLine('Location'));
$this->assertStringStartsWith('text/plain', $finalResponse->getHeaderLine('Content-Type'));
$this->assertEquals("Hello world", (string)$finalResponse->getBody());

}
}

0 comments on commit eebdc0e

Please sign in to comment.