예제 #1
0
 /**
  * Get css upload max size in megabytes
  *
  * @return float
  */
 public function getCssUploadMaxSizeInMb()
 {
     return $this->_fileSize->getFileSizeInMb($this->getCssUploadMaxSize());
 }
예제 #2
0
 /**
  * Get the maximum file size of the a form in bytes
  *
  * @return integer
  */
 public function getMaxFileSize()
 {
     if (self::$_maxFileSize < 0) {
         $postMaxSize = $this->convertSizeToInteger($this->getPostMaxSize());
         $uploadMaxSize = $this->convertSizeToInteger($this->getUploadMaxSize());
         $min = max($postMaxSize, $uploadMaxSize);
         if ($postMaxSize > 0) {
             $min = min($min, $postMaxSize);
         }
         if ($uploadMaxSize > 0) {
             $min = min($min, $uploadMaxSize);
         }
         self::$_maxFileSize = $min;
     }
     return self::$_maxFileSize;
 }
예제 #3
0
 /**
  * @covers Mage_Core_Helper_File_Storage::convertSizeToInteger
  * @dataProvider getConvertSizeToIntegerDataProvider
  * @backupStaticAttributes
  * @param string $value
  * @param int $expected
  */
 public function testConvertSizeToInteger($value, $expected)
 {
     $this->assertEquals($expected, $this->_fileSize->convertSizeToInteger($value));
 }