public function ExportDataTest::testLocations in Loft Data Grids 6.2
Same name and namespace in other branches
- 7.2 vendor/aklump/loft_data_grids/tests/phpunit/ExportDataTest.php \AKlump\LoftDataGrids\ExportDataTest::testLocations()
File
- vendor/aklump/loft_data_grids/tests/ExportDataTest.php, line 222
- Tests for the ExportData class
Class
- ExportDataTest
Namespace
AKlump\LoftDataGrids
Code
public function testLocations() {
$obj = $this->obj;
$this
->assertNull($obj
->getCurrent('Name'));
$this
->assertNull($obj
->getCurrent('Color'));
$return = $obj
->setPointer(1)
->getCurrent('Color');
$this
->assertSame('White', $return);
$obj
->storeLocation('cars');
$return = $obj
->gotoLocation('start');
$this
->assertInstanceOf('AKlump\\LoftDataGrids\\ExportData', $return);
$this
->assertSame('Hillary', $obj
->getCurrent('Name'));
$this
->assertEquals(0, $obj
->getCurrentPageId());
$this
->assertEquals(1, $obj
->getPointer());
$subject = array(
'start' => array(
'page' => 0,
'pointers' => array(
0 => 1,
1 => 0,
),
),
'cars' => array(
'page' => 1,
'pointers' => array(
0 => 1,
1 => 1,
),
),
);
$this
->assertSame($subject, $locs = $obj
->getLocations());
$copy = new ExportData();
$copy
->setLocations($locs);
$this
->assertSame($subject, $copy
->getLocations());
}