/** * Get max upload size * * @param string $configuredLimit * @return int */ private function _getMaxUploadSize($configuredLimit) { $maxIniUploadSize = $this->_fileSize->getMaxFileSize(); if ($configuredLimit === null) { return $maxIniUploadSize; } $maxUploadSize = $this->_fileSize->convertSizeToInteger($configuredLimit); return min($maxUploadSize, $maxIniUploadSize); }
/** * @dataProvider getConvertSizeToIntegerDataProvider * @backupStaticAttributes * @param string $value * @param int $expected */ public function testConvertSizeToInteger($value, $expected) { $this->assertEquals($expected, $this->_fileSize->convertSizeToInteger($value)); }