public function testGetSizeLimit()
{
$size = min($this->sizeToBytes(ini_get('upload_max_filesize')),$this->sizeToBytes(ini_get('post_max_size')));
$val = new FileValidator();
$this->assertEquals($size, $val->getSizeLimit());
$val->maxSize = $size + 1; // set and test if value is overridden
$this->assertEquals($size, $val->getSizeLimit());
$val->maxSize = abs($size - 1);
$this->assertEquals($size - 1, $val->getSizeLimit());
$_POST['MAX_FILE_SIZE'] = $size + 1;
$this->assertEquals($size - 1, $val->getSizeLimit());
$_POST['MAX_FILE_SIZE'] = abs($size - 2);
$this->assertSame($_POST['MAX_FILE_SIZE'], $val->getSizeLimit());
}