Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
[#2855] Added test for renderer.post event
Browse files Browse the repository at this point in the history
- Added a test for the renderer.post event to ensure it gets triggered
  • Loading branch information
weierophinney committed Nov 13, 2012
1 parent 2a1d136 commit 8963bcc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/ZendTest/View/ViewTest.php
Expand Up @@ -290,4 +290,20 @@ public function testUsesTreeRendererInterfaceToDetermineWhetherOrNotToPassOnlyRo


$this->assertEquals($expected, $result->content); $this->assertEquals($expected, $result->content);
} }

public function testCanTriggerPostRendererEvent()
{
$this->attachTestStrategies();
$test = (object) array('flag' => false);
$this->view->getEventManager()->attach('renderer.post', function ($e) use ($test) {
$test->flag = true;
});
$variables = array(
'foo' => 'bar',
'bar' => 'baz',
);
$this->model->setVariables($variables);
$this->view->render($this->model);
$this->assertTrue($test->flag);
}
} }

0 comments on commit 8963bcc

Please sign in to comment.