Name = "Object {$i}"; $obj->write(); } } public function testLimit() { $list = TestObject::get(); $button = new GridFieldPrintButton(); $button->setPrintColumns(array('Name' => 'My Name')); // Get paginated gridfield config $config = GridFieldConfig::create() ->addComponent(new GridFieldPaginator(10)) ->addComponent($button); $gridField = new GridField('testfield', 'testfield', $list, $config); $controller = new Controller(); /** @skipUpgrade */ new Form($controller, 'Form', new FieldList($gridField), new FieldList()); // Printed data should ignore pagination limit $printData = $button->generatePrintData($gridField); $rows = $printData->ItemRows; $this->assertEquals(42, $rows->count()); } }