function XLSExporterTest::testColumnNumberFormat in Loft Data Grids 7.2
Same name and namespace in other branches
- 6.2 vendor/aklump/loft_data_grids/tests/XLSExporterTest.php \AKlump\LoftDataGrids\XLSExporterTest::testColumnNumberFormat()
File
- vendor/
aklump/ loft_data_grids/ tests/ phpunit/ XLSXExporterTest.php, line 30 - Tests for the XLSExporter class
Class
Namespace
AKlump\LoftDataGridsCode
function testColumnNumberFormat() {
$obj = clone $this->exporter2;
$currency = 'USD';
$obj
->formatColumn('California Taxed Purchase Amount', $currency);
$obj
->formatColumn('Domestic Purchase Amount', $currency);
$record = $obj
->getData()
->setPointer(0);
$data = $record
->getCurrent();
$this
->assertSame('$0.00', $data['California Taxed Purchase Amount']);
$this
->assertSame('$20.00', $data['Domestic Purchase Amount']);
$obj = clone $this->exporter2;
$currency = '"$"#,##0.00_-';
$obj
->formatColumn('California Taxed Purchase Amount', $currency);
$obj
->formatColumn('Domestic Purchase Amount', $currency);
$record = $obj
->getData()
->setPointer(0);
$data = $record
->getCurrent();
$this
->assertSame('$0.00', $data['California Taxed Purchase Amount']);
$this
->assertSame('$20.00', $data['Domestic Purchase Amount']);
}