Exemplo n.º 1
0
 /**
  * This method tests the set method.
  *
  * @param   integer  $property  The property to set
  * @param   string   $value     The value of the property to set
  * @param   array    $expected  The expected results for the JPagination object
  *
  * @return  void
  *
  * @covers        JPagination::set
  * @dataProvider  dataSet
  * @since         3.2
  */
 public function testSet($property, $value, $expected)
 {
     $pagination = new JPagination(100, 50, 20, '', $this->app);
     $pagination->set($property, $value);
     if ($property == 'viewall') {
         $result = TestReflection::getValue($pagination, $property);
     } elseif (strpos($property, '.')) {
         $prop = explode('.', $property);
         $prop[1] = ucfirst($prop[1]);
         $property = implode($prop);
         $result = $pagination->{$property};
     } else {
         $result = $pagination->{$property};
     }
     $this->assertEquals($result, $expected, 'The expected output of the property is incorrect');
     unset($pagination);
 }
Exemplo n.º 2
0
            if ($pagesCurrent + 4 >= $pagesTotal) {
                $pagesStop = $pagesTotal;
            } else {
                $pagesStop = $pagesCurrent + 4;
            }
        } else {
            $pagesStart = 1;
            if ($pagesTotal <= 10) {
                $pagesStop = $pagesTotal;
            } else {
                $pagesStop = 10;
            }
        }
    }
}
$pagination->set("limitstart", $limitstart);
$pagination->set("limit", $limit);
$pagination->set("total", $total);
$pagination->set("pagesStart", $pagesStart);
$pagination->set("pagesStop", $pagesStop);
$pagination->set("pagesCurrent", $pagesCurrent);
$pagination->set("pagesTotal", $pagesTotal);
/*echo "<pre>";
		print_r($pagination);
		echo "</pre>";*/
echo $pagination->getListFooter();
?>
                                    </td>
                                </tr>
                            </table>
                        </div>