You are here

function CSVExporterTest::testColumnNumberFormat in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/aklump/loft_data_grids/tests/phpunit/CSVExporterTest.php \AKlump\LoftDataGrids\CSVExporterTest::testColumnNumberFormat()

File

vendor/aklump/loft_data_grids/tests/CSVExporterTest.php, line 48
Tests for the CSVExporter class

Class

CSVExporterTest

Namespace

AKlump\LoftDataGrids

Code

function testColumnNumberFormat() {
  $obj = $this->exporter;
  $currency = 'USD';
  $obj
    ->formatColumn('California Taxed Purchase Amount', $currency);
  $obj
    ->formatColumn('Domestic Purchase Amount', $currency);
  $record = $obj
    ->getData()
    ->setPage(0)
    ->setPointer(0);
  $data = $record
    ->getCurrent();
  $this
    ->assertSame('$0.00', $data['California Taxed Purchase Amount']);
  $this
    ->assertSame('$20.00', $data['Domestic Purchase Amount']);
}