You are here

function CSVExporterTest::testGetSetCurrent 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::testGetSetCurrent()

File

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

Class

CSVExporterTest

Namespace

AKlump\LoftDataGrids

Code

function testGetSetCurrent() {
  $obj = $this->exporter;
  $obj
    ->getData()
    ->setPointer(1);
  $this
    ->assertNull($obj
    ->getData()
    ->getCurrent('Order No.'));
  $return = $obj
    ->getData()
    ->setPointer(0);
  $this
    ->assertInstanceOf('AKlump\\LoftDataGrids\\ExportData', $return);
  $this
    ->assertEquals(1181, $obj
    ->getData()
    ->getCurrent('Order No.'));
  $this
    ->assertEquals(0, $obj
    ->getData()
    ->getCurrent('California Taxed Purchase Amount'));

  // Try setting the value of the California Taxed Purchase Amount
  $return = $obj
    ->getData()
    ->add('California Taxed Purchase Amount', 25.95);
  $this
    ->assertInstanceOf('AKlump\\LoftDataGrids\\ExportData', $return);
  $this
    ->assertEquals(25.95, $obj
    ->getData()
    ->getCurrent('California Taxed Purchase Amount'));
}