You are here

public function DollarFormatterTest::testFormatting in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/aklump/loft_data_grids/tests/DollarFormatterTest.php \AKlump\LoftDataGrids\DollarFormatterTest::testFormatting()

File

vendor/aklump/loft_data_grids/tests/phpunit/DollarFormatterTest.php, line 15
Tests for the DollarFormatter class

Class

DollarFormatterTest

Namespace

AKlump\LoftDataGrids

Code

public function testFormatting() {
  $obj = new DollarFormatter(98.59999999999999);
  $this
    ->assertSame('$98.60', $obj
    ->get());
  $obj = new DollarFormatter();
  $this
    ->assertSame('$0.00', $obj
    ->get());
  $obj = new DollarFormatter('$125.00');
  $this
    ->assertSame('$125.00', $obj
    ->get());
  $obj = new DollarFormatter('$65');
  $this
    ->assertSame('$65.00', $obj
    ->get());
  $obj = new DollarFormatter('123456');
  $this
    ->assertSame('$123,456.00', $obj
    ->get());
}