Przeglądaj źródła

ZF-10960
On behalf of robertbasic
Fixed Zend_Dojo_Form_Element_Editor to accept multiple separators


git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23873 44c647ce-9c0f-0410-b52a-842ac1e357ba

ralph 14 lat temu
rodzic
commit
1b9ec39f04

+ 1 - 1
library/Zend/Dojo/Form/Element/Editor.php

@@ -247,7 +247,7 @@ class Zend_Dojo_Form_Element_Editor extends Zend_Dojo_Form_Element_Dijit
     {
         $plugin = (string) $plugin;
         $plugins = $this->getPlugins();
-        if (in_array($plugin, $plugins)) {
+        if (in_array($plugin, $plugins) && $plugin !== '|') {
             return $this;
         }
 

+ 9 - 0
tests/Zend/Dojo/Form/Element/EditorTest.php

@@ -262,6 +262,15 @@ class Zend_Dojo_Form_Element_EditorTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($this->element->getDijitParam('updateInterval'), $this->element->getUpdateInterval());
         $this->assertEquals(300, $this->element->getUpdateInterval());
     }
+    
+    public function testCanAddMultipleSeparatorsToEditor()
+    {
+        $this->element->setPlugins(array('undo', '|', 'bold', '|', 'italic'));
+        
+        $plugins = $this->element->getPlugins();
+        $this->assertEquals(5, count($plugins));
+    }
+    
 }
 
 // Call Zend_Dojo_Form_Element_EditorTest::main() if this source file is executed directly.