Commit e98edcfa authored by Elias Villiger's avatar Elias Villiger
Browse files

Support #5309 (min/max) - Fix unit tests

parent c8998c9d
......@@ -101,10 +101,11 @@ class SanitizeTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals($val, Sanitize::checkMinMax($val, [ FE_MIN => "-100", FE_MAX => "200" ]), $msg);
$val = -56;
$this->assertEquals('', Sanitize::checkMinMax($val, [ FE_MIN => "0", FE_MAX => "2" ]), $msg);
$this->assertEquals($val, Sanitize::checkMinMax($val, [ FE_MIN => "0", FE_MAX => "200" ]), $msg);
$this->assertEquals('', Sanitize::checkMinMax($val, [ FE_MIN => "0", FE_MAX => "200" ]), $msg);
$this->assertEquals($val, Sanitize::checkMinMax($val, [ FE_MIN => "-100", FE_MAX => "200" ]), $msg);
# Check min/max dates
$msg = "SANITIZE_MIN_MAX Date fails";
$val = "2010-05-01";
$this->assertEquals('', Sanitize::checkMinMax($val, [ FE_MIN => "2010-01-01", FE_MAX => "2010-12-31" ]), $msg);
$this->assertEquals('', Sanitize::checkMinMax('', [ FE_MIN => "2010-01-01", FE_MAX => "2010-04-30" ]), $msg);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment