You are here

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

File

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

Class

CSVExporterTest

Namespace

AKlump\LoftDataGrids

Code

public function testSettings() {
  $obj = $this->exporter;
  $obj
    ->setSettings(array(
    'height' => 50,
  ));
  $this
    ->assertEquals((object) array(
    'height' => 50,
  ), $obj
    ->getSettings());
  $this
    ->assertSame(50, $obj
    ->getSettings()->height);
  $obj
    ->getSettings()->height = 25;
  $this
    ->assertSame(25, $obj
    ->getSettings()->height);
  $this
    ->assertEquals((object) array(
    'height' => 25,
  ), $obj
    ->getSettings());
  $obj
    ->addSetting('width', 100);
  $this
    ->assertSame(100, $obj
    ->getSettings()->width);
  $this
    ->assertEquals((object) array(
    'height' => 25,
    'width' => 100,
  ), $obj
    ->getSettings());
}