diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2011-09-05 02:07:44 -0400 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2011-09-05 02:07:44 -0400 |
commit | 511f2e04350e08ba1412a92e86427ed97775e1f4 (patch) | |
tree | 83fa1d088876103eb5323381ae831c16a6fe0ed3 /tests/template/template_test_case.php | |
parent | 6216e6748c99eef54ce366c77007ca161b4b0e19 (diff) | |
download | forums-511f2e04350e08ba1412a92e86427ed97775e1f4.tar forums-511f2e04350e08ba1412a92e86427ed97775e1f4.tar.gz forums-511f2e04350e08ba1412a92e86427ed97775e1f4.tar.bz2 forums-511f2e04350e08ba1412a92e86427ed97775e1f4.tar.xz forums-511f2e04350e08ba1412a92e86427ed97775e1f4.zip |
[ticket/10355] Correctly end output buffering in template tests.
This code was copied verbatim from develop-olympus.
PHPBB3-10355
Diffstat (limited to 'tests/template/template_test_case.php')
-rw-r--r-- | tests/template/template_test_case.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php index e475e4012f..7cf995f194 100644 --- a/tests/template/template_test_case.php +++ b/tests/template/template_test_case.php @@ -21,8 +21,22 @@ class phpbb_template_template_test_case extends phpbb_test_case protected function display($handle) { 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) |