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 3412209da8916cd54e6502d22443a34ad01c1de8 2 parents a67ae5c + 79f2522
@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.