mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
83e90aaafe
This class extends the DataGridPresenter with the behaviour and looks of a paginated Datagrid.
38 lines
1.0 KiB
PHP
38 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* @package sapphire
|
|
* @subpackage tests
|
|
*/
|
|
class GridFieldPaginatorTest extends SapphireTest {
|
|
|
|
/**
|
|
*
|
|
* @var string
|
|
*/
|
|
public static $fixture_file = 'sapphire/tests/forms/GridFieldTest.yml';
|
|
|
|
/**
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $extraDataObjects = array(
|
|
'GridFieldTest_Person',
|
|
);
|
|
|
|
public function testGetInstance() {
|
|
$this->assertTrue(new GridFieldPaginator(1,1) instanceof GridFieldPaginator, 'Trying to find an instance of GridFieldPaginator');
|
|
$this->assertTrue(new GridFieldPaginator_Extension() instanceof GridFieldPaginator_Extension, 'Trying to find an instance of GridFieldPaginator_Extension');
|
|
}
|
|
|
|
public function testFlowThroughGridFieldExtension() {
|
|
$list = new DataList('GridFieldTest_Person');
|
|
$t = new GridFieldPaginator_Extension();
|
|
$t->paginationLimit(5);
|
|
|
|
$parameters = new stdClass();
|
|
$parameters->Request = new SS_HTTPRequest('GET', '/a/url', array('page'=>1));
|
|
|
|
$t->filterList($list, $parameters);
|
|
$this->assertTrue($t->Footer() instanceof GridFieldPaginator);
|
|
}
|
|
} |