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

Robert Basic Matthew Weier O'Phinney
Robert Basic

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

Matthew Weier O'Phinney

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. Robert Basic
This page is out of date. Refresh to see the latest.
2  library/Zend/Dojo/Form/Element/ValidationTextBox.php
View
@@ -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;
9 tests/Zend/Dojo/Form/Element/ValidationTextBoxTest.php
View
@@ -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.