Commit 34abcdd7 authored by Elias Villiger's avatar Elias Villiger
Browse files

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

parent e98edcfa
......@@ -107,12 +107,11 @@ class SanitizeTest extends \PHPUnit_Framework_TestCase {
# 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);
$this->assertEquals('', Sanitize::checkMinMax('', [ FE_MIN => "2010-01-01", FE_MAX => "2009-12-31" ]), $msg);
$this->assertEquals('', Sanitize::checkMinMax('', [ FE_MIN => "2011-01-01", FE_MAX => "2009-12-31" ]), $msg);
$this->assertEquals('', Sanitize::checkMinMax('', [ FE_MIN => "2010-01-01", FE_MAX => "2010-04-30" ]), $msg);
$this->assertEquals('', Sanitize::checkMinMax($val, [ FE_MIN => "2010-05-01", FE_MAX => "2010-05-01" ]), $msg);
$this->assertEquals($val, Sanitize::checkMinMax($val, [ FE_MIN => "2010-01-01", FE_MAX => "2010-12-31" ]), $msg);
$this->assertEquals('', Sanitize::checkMinMax($val, [ FE_MIN => "2010-01-01", FE_MAX => "2010-04-30" ]), $msg);
$this->assertEquals('', Sanitize::checkMinMax($val, [ FE_MIN => "2010-01-01", FE_MAX => "2009-12-31" ]), $msg);
$this->assertEquals('', Sanitize::checkMinMax($val, [ FE_MIN => "2011-01-01", FE_MAX => "2009-12-31" ]), $msg);
$this->assertEquals($val, Sanitize::checkMinMax($val, [ FE_MIN => "2010-05-01", FE_MAX => "2010-05-01" ]), $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