public function testStringSerializationShouldBeDoctypeAware() { $view = $this->getView(); $view->doctype('HTML4_LOOSE'); $this->helper->setView($view); $this->setupDojo(); $html = $this->helper->__toString(); $this->assertRegexp('|<style [^>]*>[\\r\\n]+\\s*<!--|', $html); $this->assertRegexp('|<script [^>]*>[\\r\\n]+\\s*//<!--|', $html); $this->helper = new Zend_Dojo_View_Helper_Dojo(); $view->doctype('XHTML1_STRICT'); $this->helper->setView($view); $this->setupDojo(); $html = $this->helper->__toString(); /** * @todo should stylesheets be escaped as CDATA when isXhtml()? */ $this->assertRegexp('|<style [^>]*>[\\r\\n]+\\s*<!--|', $html); $this->assertRegexp('|<script [^>]*>[\\r\\n]+\\s*//<!\\[CDATA\\[|', $html); }
/** * Set view object * * @param Zend_Dojo_View_Interface $view * @return void */ public function setView(Zend_View_Interface $view) { $this->view = $view; $this->_container->setView($view); }