예제 #1
0
파일: TableTest.php 프로젝트: drahak/tables
 public function testPaginator()
 {
     $paginator = $this->getMock('Nette\\Utils\\Paginator');
     // Data source expectation
     $this->table->setDataSource($this->dataSource);
     $this->dataSource->expects($this->once())->method('limit')->with(10, 0);
     // Paginator expectation
     $paginator->expects($this->once())->method('getItemsPerPage')->will($this->returnValue(10));
     $paginator->expects($this->once())->method('getOffset')->will($this->returnValue(0));
     $this->table->setPaginator($paginator);
     $this->assertInstanceOf('Nette\\Utils\\Paginator', $this->table->getPaginator());
     $this->assertSame($paginator, $this->table->getPaginator());
 }
예제 #2
0
 /**
  * Render table end
  * @param Table $table
  * @return string
  */
 public static function renderTableEnd(Table $table)
 {
     echo $table->getElementPrototype()->endTag();
 }