/** * Test beforeRender callback * * @return void */ public function testBeforeRender() { $this->assertTrue(empty($this->View->viewVars)); $this->CommentWidget->beforeRender('view.ctp'); $this->assertFalse($this->CommentWidget->enabled); $this->View->viewVars['commentParams'] = array('displayType' => 'flat'); $this->CommentWidget->beforeRender(); $this->assertFalse($this->CommentWidget->enabled); $this->View->viewVars['commentParams'] = array('displayType' => 'flat', 'viewComments' => 'commentsData'); $this->CommentWidget->beforeRender('view.ctp'); $this->assertTrue($this->CommentWidget->enabled); }