You are here

public function AccessingDataTest::testGetRows 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::testGetRows()

File

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

Class

AccessingDataTest

Namespace

AKlump\LoftDataGrids

Code

public function testGetRows() {
  $obj = new ExportData();
  $this
    ->assertSame(array(), $obj
    ->getRows());
  $obj
    ->add('name', 'bob')
    ->next();
  $obj
    ->add('name', 'charlie')
    ->next();
  $obj
    ->add('name', 'dave')
    ->next();
  $control = array(
    0 => array(
      'name' => 'bob',
    ),
    1 => array(
      'name' => 'charlie',
    ),
    2 => array(
      'name' => 'dave',
    ),
  );
  $this
    ->assertSame($control, $obj
    ->getRows());
  $this
    ->assertSame('dave', $obj
    ->setPointer(2)
    ->getValue('name'));
}