Example #1
0
 public function testShouldAllowProgrammaticDijitCreation()
 {
     DojoHelper::setUseProgrammatic();
     $html = $this->getForm();
     $this->assertNotRegexp('/<form[^>]*(dojoType="dijit.form.Form")/', $html);
     $this->assertNotNull($this->view->dojo()->getDijit('myForm'));
 }
Example #2
0
 public function testShouldAllowProgrammaticDijitCreation()
 {
     DojoHelper::setUseProgrammatic();
     $html = $this->getElement();
     $this->assertNotRegexp('/<button[^>]*(dojoType="dijit.form.Button")/', $html);
     $this->assertNotNull($this->view->plugin('dojo')->getDijit('elementId'));
 }
Example #3
0
 public function testShouldAllowProgrammaticDijitCreation()
 {
     DojoHelper::setUseProgrammatic();
     $html = $this->getElement();
     $this->assertNotRegexp('/<textarea[^>]*(dojoType="dijit.form.Textarea")/', $html);
     $this->assertNotNull($this->view->dojo()->getDijit('elementId'));
 }
Example #4
0
 public function testShouldAllowProgrammaticDijitCreation()
 {
     DojoHelper::setUseProgrammatic();
     $html = $this->getElement();
     $this->assertNotRegexp('/<input[^>]*(dojoType="dijit.form.DateTextBox")/', $html);
     $this->assertNotNull($this->view->broker('dojo')->getDijit('elementId'));
 }
 public function testShouldAllowProgrammaticDijitCreation()
 {
     DojoHelper::setUseProgrammatic();
     $html = $this->getContainer();
     $this->assertNotRegexp('/<div[^>]*(dojoType="dijit.layout.AccordionContainer")/', $html);
     $this->assertNotNull($this->view->broker('dojo')->getDijit('container'));
 }
Example #6
0
 public function testShouldAllowProgrammaticDijitCreation()
 {
     DojoHelper::setUseProgrammatic();
     $html = $this->getElement();
     $this->assertNotRegexp('/<div[^>]*(dojoType="dijit.form.HorizontalSlider")/', $html);
     $this->assertNotNull($this->view->broker('dojo')->getDijit('elementId-slider'));
 }
Example #7
0
 /**
  * @group ZF-3877
  */
 public function testContentPaneMarkupShouldNotContainNameAttribute()
 {
     $html = $this->view->plugin('contentPane')->__invoke('pane1', 'This is the pane content', array('id' => 'pane', 'title' => 'Pane 1'));
     $this->assertNotContains('name="/', $html, $html);
     DojoHelper::setUseProgrammatic();
     $html = $this->view->plugin('contentPane')->__invoke('pane1', 'This is the pane content', array('id' => 'pane', 'title' => 'Pane 1'));
     $this->assertNotContains('name="/', $html, $html);
 }
Example #8
0
 public function testInvalidFlagPassedToUseProgrammaticShouldUseProgrammaticWithScripts()
 {
     DojoHelper::setUseProgrammatic('foo');
     $this->assertFalse(DojoHelper::useProgrammaticNoScript());
     $this->assertTrue(DojoHelper::useProgrammatic());
 }
Example #9
0
 /**
  * @group ZF-7134
  * @group ZF-7266
  */
 public function testComboBoxInSubFormShouldCreateJsonStoreBasedOnQualifiedId()
 {
     DojoHelper::setUseProgrammatic();
     $this->element->setStoreId('foo')->setStoreType('dojo.data.ItemFileReadStore')->setStoreParams(array('url' => '/foo'));
     $subform = new SubForm(array('name' => 'bar'));
     $subform->addElement($this->element);
     $html = $this->element->render();
     $dojo = $this->view->dojo()->__toString();
     $this->assertContains('"store":"foo"', $dojo, $dojo);
 }
Example #10
0
 public function testHelperInProgrammaticModeShouldGenerateDivWithoutPassedDojoType()
 {
     DojoHelper::setUseProgrammatic();
     $content = $this->view->plugin('customDijit')->__invoke('foo', 'content', array('dojoType' => 'custom.Dijit'));
     $this->assertNotContains('dojoType="custom.Dijit"', $content);
 }
Example #11
0
 /**
  * @group ZF-5987
  * @group ZF-7266
  */
 public function testStoreCreationWhenUsingProgrammaticCreationShouldRegisterAsDojoJavascript()
 {
     DojoHelper::setUseProgrammatic(true);
     $html = $this->getElementAsRemoter();
     $js = $this->view->plugin('dojo')->getJavascript();
     $this->assertContains('var stateStore;', $js);
     $onLoad = $this->view->plugin('dojo')->_getZendLoadActions();
     $storeDeclarationFound = false;
     foreach ($onLoad as $statement) {
         if (strstr($statement, 'stateStore = new ')) {
             $storeDeclarationFound = true;
             break;
         }
     }
     $this->assertTrue($storeDeclarationFound, 'Store definition not found');
 }
Example #12
0
 public function testShouldAllowProgrammaticDijitCreationAsRemoter()
 {
     DojoHelper::setUseProgrammatic();
     $html = $this->getElementAsRemoter();
     $this->assertNotRegexp('/<input[^>]*(dojoType="dijit.form.FilteringSelect")/', $html);
     $this->assertRegexp('/<input[^>]*(type="text")/', $html);
     $this->assertNotNull($this->view->plugin('dojo')->getDijit('elementId'));
     $this->assertContains('var stateStore;', $this->view->plugin('dojo')->getJavascript());
     $found = false;
     $scripts = $this->view->plugin('dojo')->_getZendLoadActions();
     foreach ($scripts as $js) {
         if (strstr($js, 'stateStore = new ')) {
             $found = true;
             break;
         }
     }
     $this->assertTrue($found, 'No store declaration found: ' . var_export($scripts, 1));
 }