mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Merge remote-tracking branch 'p/ticket/10355' into develop
* p/ticket/10355: [ticket/10355] Correctly end output buffering in template tests.
This commit is contained in:
commit
6f9df6199c
1 changed files with 16 additions and 2 deletions
|
@ -21,8 +21,22 @@ class phpbb_template_template_test_case extends phpbb_test_case
|
||||||
protected function display($handle)
|
protected function display($handle)
|
||||||
{
|
{
|
||||||
ob_start();
|
ob_start();
|
||||||
$this->assertTrue($this->template->display($handle));
|
|
||||||
return self::trim_template_result(ob_get_clean());
|
try
|
||||||
|
{
|
||||||
|
$this->assertTrue($this->template->display($handle, false));
|
||||||
|
}
|
||||||
|
catch (Exception $exception)
|
||||||
|
{
|
||||||
|
// reset output buffering even when an error occured
|
||||||
|
// PHPUnit turns trigger_error into exceptions as well
|
||||||
|
ob_end_clean();
|
||||||
|
throw $exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = self::trim_template_result(ob_get_clean());
|
||||||
|
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function trim_template_result($result)
|
protected static function trim_template_result($result)
|
||||||
|
|
Loading…
Add table
Reference in a new issue