You are here

public function ExportDataTest::testShowKeys in Loft Data Grids 7.2

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

File

vendor/aklump/loft_data_grids/tests/phpunit/ExportDataTest.php, line 21
Tests for the ExportData class

Class

ExportDataTest

Namespace

AKlump\LoftDataGrids

Code

public function testShowKeys() {
  $obj = $this->obj;
  $obj
    ->setPage(0);
  $control = array(
    0 => array(
      0 => array(),
      1 => array(),
      2 => array(),
    ),
    1 => array(
      0 => array(
        'Color' => 'Black',
        'Make' => 'Subaru',
      ),
      1 => array(
        'Color' => 'White',
        'Make' => 'Hyundai',
      ),
    ),
  );
  $obj
    ->hideKeys(true);
  $this
    ->assertSame($control, $obj
    ->get());
  $return = $obj
    ->showKeys('Age')
    ->getPage();
  $control = array(
    0 => array(
      'Age' => 39,
    ),
    1 => array(
      'Age' => 37,
    ),
    2 => array(
      'Age' => 7,
    ),
  );
  $this
    ->assertSame($control, $return);
}