Skip to content
Browse files

test case for exception in view

  • Loading branch information...
1 parent 6efa07d commit 2a16b003035333c7848f4d082309bfe27924722b @radnan committed
Showing with 14 additions and 0 deletions.
  1. +14 −0 tests/ZendTest/View/PhpRendererTest.php
View
14 tests/ZendTest/View/PhpRendererTest.php
@@ -330,6 +330,20 @@ public function testRenderedViewModelIsRegisteredAsCurrentViewModel()
$this->assertSame($model, $helper->getCurrent());
}
+ public function testRendererRaisesExceptionInCaseOfExceptionInView()
+ {
+ $resolver = new TemplateMapResolver(array(
+ 'exception' => __DIR__ . '../../Mvc/View/_files/exception.phtml',
+ ));
+ $this->renderer->setResolver($resolver);
+
+ $model = new ViewModel();
+ $model->setTemplate('exception');
+
+ $this->setExpectedException('Exception', 'thrown from view script');
+ $this->renderer->render($model);
+ }
+
public function testRendererRaisesExceptionIfResolverCannotResolveTemplate()
{
$expected = '10 > 9';

0 comments on commit 2a16b00

Please sign in to comment.
Something went wrong with that request. Please try again.