Пример #1
0
 public function testCalculatePages()
 {
     $handler = new Handler($dataGrid = $this->getMockDataGrid());
     $handler->setUpDataHandlerContext();
     $handler->setSort('first_name');
     $handler->setDirection('asc');
     $handler->setDefaultColumn('age');
     $handler->setTransformer(function ($el) {
         $el['first_name'] = 'Name';
     });
     $pages = $handler->calculatePages(19, 6, 9);
     $this->assertEquals($pages[0], 6);
     $this->assertEquals($pages[1], 3);
     $this->assertNull($pages[2]);
 }