Browse Source

added unit test for #8203

tags/2.0.4
Carsten Brandt 10 years ago
parent
commit
1b1147bdad
  1. 6
      tests/framework/i18n/FormatterNumberTest.php

6
tests/framework/i18n/FormatterNumberTest.php

@ -374,6 +374,12 @@ class FormatterNumberTest extends TestCase
$this->assertSame("1 KB", $this->formatter->asShortSize(1000));
$this->assertSame("1.02 KB", $this->formatter->asShortSize(1023));
$this->assertNotEquals("3 PB", $this->formatter->asShortSize(3 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000)); // this is 3 EB not 3 PB
// string values
$this->assertSame("28.41 GB", $this->formatter->asShortSize(28406984038));
$this->assertSame("28.41 GB", $this->formatter->asShortSize((string)28406984038));
$this->assertSame("56.81 GB", $this->formatter->asShortSize(28406984038 + 28406984038));
$this->assertSame("56.81 GB", $this->formatter->asShortSize((string)(28406984038 + 28406984038)));
// tests for base 1024
$this->formatter->sizeFormatBase = 1024;
$this->assertSame("1 KiB", $this->formatter->asShortSize(1024));

Loading…
Cancel
Save