You are here

public function AccessingDataTest::testGetValue in Loft Data Grids 6.2

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

File

vendor/aklump/loft_data_grids/tests/AccessingDataTest.php, line 53
Tests for the ExportData class data access.

Class

AccessingDataTest

Namespace

AKlump\LoftDataGrids

Code

public function testGetValue() {
  $obj = new ExportData();
  $obj
    ->add('Name', 'Aaron')
    ->add('Age', 39)
    ->next();
  $obj
    ->add('Name', 'Hillary')
    ->add('Age', 37)
    ->next();
  $obj
    ->add('Name', 'Maia')
    ->add('Age', 7)
    ->next();
  $obj
    ->setPage(1);
  $obj
    ->add('Color', 'Black')
    ->add('Make', 'Subaru')
    ->next();
  $obj
    ->add('Color', 'White')
    ->add('Make', 'Hyundai')
    ->next();
  $return = $obj
    ->setPage(0)
    ->setPointer(0)
    ->getValue('Age');
  $this
    ->assertSame(39, $return);
  $return = $obj
    ->setPage(0)
    ->getValue('Name');
  $this
    ->assertSame('Aaron', $return);
  $return = $obj
    ->setPage(1)
    ->setPointer(0)
    ->getValue('Color');
  $this
    ->assertSame('Black', $return);
  $return = $obj
    ->getValue('Make');
  $this
    ->assertSame('Subaru', $return);
}