Skip to content

Commit

Permalink
test: add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Jun 2, 2024
1 parent 482b8bb commit 10a0739
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/system/Helpers/NumberHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public function testRomanNumber(): void
$this->assertSame('X', number_to_roman(10));
}

public function testRomanNumberString(): void
{
$this->assertSame('XCVI', number_to_roman('96'));
}

public function testRomanNumberRange(): void
{
$this->assertNull(number_to_roman(-1));
Expand Down Expand Up @@ -70,6 +75,11 @@ public function testNumberToSize(): void
$this->assertSame('456 Bytes', number_to_size(456, 1, 'en_US'));
}

public function testNumberToSizeString(): void
{
$this->assertSame('456 Bytes', number_to_size('456', 1, 'en_US'));
}

public function testKbFormat(): void
{
$this->assertSame('4.5 KB', number_to_size(4567, 1, 'en_US'));
Expand Down Expand Up @@ -109,6 +119,11 @@ public function testThousands(): void
$this->assertSame('1,000 thousand', number_to_amount('999999', 0, 'en_US'));
}

public function testThousandsInt(): void
{
$this->assertSame('123 thousand', number_to_amount(123000, 0, 'en_US'));
}

public function testMillions(): void
{
$this->assertSame('123.4 million', number_to_amount('123,400,000', 1, 'en_US'));
Expand Down

0 comments on commit 10a0739

Please sign in to comment.