Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'hotfix/3164' into develop

Forward port #3164
  • Loading branch information...
commit 5c27e8e7778707123ed8a35d2b066ebfce6301f6 2 parents 56e61bd + 3b34b8b
@weierophinney weierophinney authored
View
2  library/Zend/Validator/Step.php
@@ -98,7 +98,7 @@ public function getBaseValue()
*/
public function setStep($step)
{
- $this->step = $step;
+ $this->step = (float) $step;
return $this;
}
View
14 tests/ZendTest/Validator/StepTest.php
@@ -190,4 +190,18 @@ public function testEqualsMessageTemplates()
$this->assertAttributeEquals($validator->getOption('messageTemplates'),
'messageTemplates', $validator);
}
+
+ public function testSetStepFloat()
+ {
+ $step = 0.01;
+ $this->_validator->setStep($step);
+ $this->assertAttributeSame($step, 'step', $this->_validator);
+ }
+
+ public function testSetStepString()
+ {
+ $step = '0.01';
+ $this->_validator->setStep($step);
+ $this->assertAttributeSame((float) $step, 'step', $this->_validator);
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.