Example #1
0
 /**
  * Test iec convert
  */
 public function testNormIec()
 {
     $this->assertEquals('1 B', $this->_fs->fileSize(1, null, 'iec'));
     $this->assertEquals('1 KiB', $this->_fs->fileSize(1024, null, 'iec'));
     $this->assertEquals('1 MiB', $this->_fs->fileSize(1024 * 1024, null, 'iec'));
     $this->assertEquals('1 GiB', $this->_fs->fileSize(1024 * 1024 * 1024, null, 'iec'));
 }
Example #2
0
 /**
  * Test when no locale is set
  */
 public function testNoLocaleSet()
 {
     Zend_Registry::getInstance()->_unsetInstance();
     $this->assertEquals("976.563 kB", $this->_fs->fileSize(1000000, 3));
     $this->assertEquals("976.5625 kB", $this->_fs->fileSize(1000000, 4));
     $this->assertEquals("976.5625000000 kB", $this->_fs->fileSize(1000000, 10));
     $this->assertEquals("1.1 MB", $this->_fs->fileSize('1153433.6', 1));
     $this->assertEquals("1.1 MB", $this->_fs->fileSize('1153433,6', 1));
     //Czech decimal separator
 }