Skip to content

Commit

Permalink
test case for exception in view
Browse files Browse the repository at this point in the history
  • Loading branch information
radnan committed Jan 9, 2013
1 parent 6efa07d commit 2a16b00
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/ZendTest/View/PhpRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 2a16b00

Please sign in to comment.