Permalink
Browse files

[#2855] Added test for renderer.post event

- Added a test for the renderer.post event to ensure it gets triggered
  • Loading branch information...
1 parent 2a1d136 commit 8963bcc81ee2eb1275e34d777f4577097e939139 @weierophinney weierophinney committed Nov 13, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 tests/ZendTest/View/ViewTest.php
@@ -290,4 +290,20 @@ public function testUsesTreeRendererInterfaceToDetermineWhetherOrNotToPassOnlyRo
$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.