/** * Set view * * Set view and enable dojo * * @param Zend_View_Interface $view * @return Zend_Dojo_View_Helper_Dijit */ public function setView(Zend_View_Interface $view) { parent::setView($view); $this->dojo = $this->view->dojo(); $this->dojo->enable(); return $this; }
public function testShouldAllowAddingArbitraryJsToPrimaryDojoScriptTag() { $this->helper->enable(); $this->helper->addJavascript('var foo = "bar";'); $html = $this->helper->__toString(); $found = false; if (preg_match_all('|<script[^>]*>(.*?)(</script>)|s', $html, $m)) { foreach ($m[1] as $script) { if (strstr($script, 'var foo = "bar";')) { $found = true; break; } } } $this->assertTrue($found, 'Js not found: ' . $html); }