$this->
assertNull($view->
getCurrentPage(), 'If the pager is not initialized and no manual override there is no current page.'
);
$rand_number =
rand(1, 5
);
$view->
setCurrentPage($rand_number);
$this->
assertEquals($rand_number,
$view->
getCurrentPage(), 'Make sure getCurrentPage uses the settings of set_current_page.'
);
$view->
destroy();
// On this round enable the pager.
$view->
initDisplay();
$view->
initQuery();
$view->
initPager();
$this->
assertEquals(5,
$view->
getItemsPerPage(), 'Per default the view has 5 items per page.'
);
$rand_number =
rand(1, 5
);
$view->
setItemsPerPage($rand_number);
$rand_number =
rand(6, 11
);
$view->pager->
setItemsPerPage($rand_number);
$this->
assertEquals($rand_number,
$view->
getItemsPerPage(), 'Make sure getItemsPerPage uses the settings of setItemsPerPage.'
);
$this->
assertEquals(0,
$view->
getOffset(), 'Per default a view has a 0 offset.'
);
$rand_number =
rand(1, 5
);
$view->
setOffset($rand_number);