Skip to content

Commit fdc3ab6

Browse files
committed
Add tests
1 parent 01e52dc commit fdc3ab6

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

tests/FileSizeTest.php

+21-1
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,30 @@ public function autoRounding()
170170
/**
171171
* @test a decimal base conversion.
172172
*/
173-
public function testDecimalBase()
173+
public function decimalBase()
174174
{
175175
$size = new FileSize(10921134, 10);
176176

177177
$this->assertSame($size->asAuto(), '10.92 MB');
178178
}
179+
180+
/**
181+
* @test a custom decimal separator.
182+
*/
183+
public function decimalMark()
184+
{
185+
$size = new FileSize(10921134, 10, ',');
186+
187+
$this->assertSame($size->asAuto(), '10,92 MB');
188+
}
189+
190+
/**
191+
* @test custom decimal separators and thousands marks.
192+
*/
193+
public function decimalAndThousandsMarks()
194+
{
195+
$size = new FileSize('1.234.522.678,12 KB', 2, ',');
196+
197+
$this->assertSame($size->asAuto(), '1,15 TB');
198+
}
179199
}

0 commit comments

Comments
 (0)