Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

importing the fix for ZF-8453 #272

Closed
wants to merge 1 commit into from

2 participants

@robertbasic

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

@weierophinney

Reviewed, merged, and pushed to master; thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 27, 2011
  1. @robertbasic
This page is out of date. Refresh to see the latest.
View
2  library/Zend/Dojo/Form/Element/ValidationTextBox.php
@@ -133,6 +133,8 @@ public function setConstraint($key, $value)
*/
public function setConstraints(array $constraints)
{
+ $tmp = $this->getConstraints();
+ $constraints = array_merge($tmp, $constraints);
array_walk_recursive($constraints, array($this, '_castBoolToString'));
$this->setDijitParam('constraints', $constraints);
return $this;
View
9 tests/Zend/Dojo/Form/Element/ValidationTextBoxTest.php
@@ -145,4 +145,13 @@ public function testShouldRenderValidationTextBoxDijit()
$html = $this->element->render();
$this->assertContains('dojoType="dijit.form.ValidationTextBox"', $html);
}
+
+ public function testSettingMultipleConstraintsShouldNotOverridePreviousConstraints()
+ {
+ $this->element->setConstraint('foo', 'bar');
+
+ $this->element->setConstraints(array('spam' => 'ham'));
+
+ $this->assertEquals('bar', $this->element->getConstraint('foo'));
+ }
}
Something went wrong with that request. Please try again.