Example #1
0
 public function testStrictVars()
 {
     $view = new View();
     $view->setScriptPath(__DIR__ . DIRECTORY_SEPARATOR . '_templates');
     $view->strictVars(true);
     set_error_handler(array($this, 'handleNotices'), E_USER_NOTICE);
     $content = $view->render('testStrictVars.phtml');
     restore_error_handler();
     foreach (array('foo', 'bar') as $key) {
         $this->assertContains('Key "' . $key . '" does not exist', $this->notices);
     }
 }