Ejemplo n.º 1
0
 function testPaginate()
 {
     $output1 = '<a href="#1">1</a>&nbsp;<a href="#2">2</a>&nbsp;';
     $output2 = '<span>1&nbsp;</span><a href="#2">2</a>&nbsp;';
     $output3 = '<span>1&nbsp;</span>&nbsp;<a href="#2">2</a>&nbsp;&nbsp;...&nbsp;<a href="#4">4</a>&nbsp;';
     $output4 = '<span>1&nbsp;</span>&nbsp;...&nbsp;<a href="#3">3</a>&nbsp;&nbsp;<a href="#4">4</a>&nbsp;';
     $pg = Raxan::paginate(2, 3);
     $this->compare($output1, $pg, 'Simple paginator');
     $pg = Raxan::paginate(2, 1);
     $this->compare($output2, $pg, 'Page 1 selected');
     // paginator with truncate options
     $pg = Raxan::paginate(4, 1, array('truncate' => -1.2, 'delimiter' => '&nbsp;'));
     $this->compare($output3, $pg, 'Paginator with truncate (-1.2) and delimiter options');
     // paginator with truncate options
     $pg = Raxan::paginate(4, 1, array('truncate' => 1.1, 'delimiter' => '&nbsp;'));
     $this->compare($output4, $pg, 'Paginator with truncate (1.1) and delimiter options');
 }