Skip to content
This repository

importing the fix for ZF-8453 #272

Closed
wants to merge 1 commit into from

2 participants

Robert Basic Matthew Weier O'Phinney
Robert Basic

Importing the fix for ZF-8453 which is fixed in ZF1

Matthew Weier O'Phinney
Owner

Reviewed, merged, and pushed to master; thanks!

Matthew Weier O'Phinney weierophinney closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jul 27, 2011
Robert Basic importing the fix for ZF-8453 b00ed56
This page is out of date. Refresh to see the latest.
2  library/Zend/Dojo/Form/Element/ValidationTextBox.php
@@ -133,6 +133,8 @@ public function setConstraint($key, $value)
133 133
      */
134 134
     public function setConstraints(array $constraints)
135 135
     {
  136
+        $tmp = $this->getConstraints();
  137
+        $constraints = array_merge($tmp, $constraints);
136 138
         array_walk_recursive($constraints, array($this, '_castBoolToString'));
137 139
         $this->setDijitParam('constraints', $constraints);
138 140
         return $this;
9  tests/Zend/Dojo/Form/Element/ValidationTextBoxTest.php
@@ -145,4 +145,13 @@ public function testShouldRenderValidationTextBoxDijit()
145 145
         $html = $this->element->render();
146 146
         $this->assertContains('dojoType="dijit.form.ValidationTextBox"', $html);
147 147
     }
  148
+    
  149
+    public function testSettingMultipleConstraintsShouldNotOverridePreviousConstraints()
  150
+    {
  151
+        $this->element->setConstraint('foo', 'bar');
  152
+        
  153
+        $this->element->setConstraints(array('spam' => 'ham'));
  154
+        
  155
+        $this->assertEquals('bar', $this->element->getConstraint('foo'));
  156
+    }
148 157
 }
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.