Skip to content

Commit 96108c2

Browse files
committed
Create test for unwrapping formatted numbers
1 parent 6283103 commit 96108c2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/HtmlPiecesTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
use PHPUnit\Framework\TestCase;
4+
use hmerritt\HtmlPieces;
5+
6+
class HtmlPiecesTest extends TestCase {
7+
8+
public function test_unwrapFormattedNumber()
9+
{
10+
$htmlPieces = new HtmlPieces;
11+
12+
$this->assertEquals("1500000", $htmlPieces->unwrapFormattedNumber("1.5M"));
13+
$this->assertEquals("1200", $htmlPieces->unwrapFormattedNumber("1.2K"));
14+
$this->assertEquals("1.8", $htmlPieces->unwrapFormattedNumber("1.8"));
15+
// $this->assertEquals($expected, $actual);
16+
}
17+
18+
}

0 commit comments

Comments
 (0)