view = $this->getView(); $this->jquery = new ZendX_JQuery_View_Helper_JQuery_Container(); $this->jquery->setView($this->view); Zend_Registry::set('ZendX_JQuery_View_Helper_JQuery', $this->jquery); } public function tearDown() { ZendX_JQuery_View_Helper_JQuery::disableNoConflictMode(); } public function getView() { require_once 'Zend/View.php'; $view = new Zend_View(); $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper'); return $view; } public function testCallingInViewEnablesJQueryHelper() { $element = $this->view->slider("element", ""); $this->assertTrue($this->jquery->isEnabled()); $this->assertTrue($this->jquery->uiIsEnabled()); } public function testShouldAppendToJqueryHelper() { $element = $this->view->slider("elem1", "", array("option" => "true")); $jquery = $this->view->jQuery()->__toString(); $this->assertContains('slider(', $jquery); $this->assertContains('"option":"true"', $jquery); } public function testShouldBuiltSliderElementsWith15API() { $this->view->jQuery()->setUiVersion("1.5.2"); $element = $this->view->slider("elem1", "75", array(), array()); $this->assertEquals( array( '$("#elem1-slider").slider({"handles":[{"start":"75"}],"change":function(e, ui) { $("#elem1").attr("value", $("#elem1-slider").slider("value", 0)); } });' ), $this->jquery->getOnLoadActions()); $this->assertContains("