Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
#223 #224 Correcting ob_start() callback redundancy, restoring `ob_…
Browse files Browse the repository at this point in the history
…end_flush()`
  • Loading branch information
Ocramius committed Jan 17, 2017
1 parent 7209f56 commit 0a53bbf
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/Response/SapiStreamEmitterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,20 @@ public function testEmitMemoryUsage($seekable, $maxBufferLength, $sizeBlocks, $m
$response = $response->withHeader('Content-Range', 'bytes ' . $first . '-' . $last . '/*');
}

ob_start(function ($output) use (& $closureTrackMemoryUsage) {
call_user_func($closureTrackMemoryUsage);
return "";
}, $maxBufferLength);
ob_start(
function () use (& $closureTrackMemoryUsage) {
$closureTrackMemoryUsage();

return '';
},
$maxBufferLength
);

gc_collect_cycles();

$this->emitter->emit($response, $maxBufferLength);

ob_end_clean();
ob_end_flush();

gc_collect_cycles();

Expand Down

0 comments on commit 0a53bbf

Please sign in to comment.