function testHttp_ViewSetEscape() { $locator = new A_Locator(); $view = new A_Http_View($locator); $str = '<hr style="foo"> &'; $str_escaped = '<hr style="foo"> &'; $file = 'foobar.php'; $view->setTemplate($file); $view->setTemplatePath(dirname(__FILE__) . '/templates'); $view->setEscape('foo', $str); $view->set('bar', ''); $this->assertEqual($str_escaped, $view->render()); $view->escapeField('foo'); $view->set('foo', $str); $view->set('bar', ''); $this->assertEqual($str_escaped, $view->render()); $view->escapeField(array('foo', 'bar')); $view->set('foo', $str); $view->set('bar', $str); $this->assertEqual($str_escaped . $str_escaped, $view->render()); }