Skip to content

Commit 3b92a5f

Browse files
committed
tests: added output buffer level check
1 parent 170b978 commit 3b92a5f

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

tests/Application/MicroPresenter.response.phpt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,13 @@ class Responder
5151
public static function render(Nette\Application\Responses\TextResponse $response)
5252
{
5353
ob_start();
54-
$response->send(new Http\Request(new Http\UrlScript()), new Http\Response(NULL));
55-
return ob_get_clean();
54+
try {
55+
$response->send(new Http\Request(new Http\UrlScript()), new Http\Response(NULL));
56+
return ob_get_clean();
57+
} catch (\Exception $e) {
58+
ob_end_clean();
59+
throw $e;
60+
}
5661
}
5762
}
5863

tests/bootstrap.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
date_default_timezone_set('Europe/Prague');
1515

1616

17+
// output buffer level check
18+
register_shutdown_function(function ($level) {
19+
Tester\Assert::same($level, ob_get_level());
20+
}, ob_get_level());
21+
22+
1723
function test(\Closure $function)
1824
{
1925
$function();

0 commit comments

Comments
 (0)